I know you have had many other doubts related to this same issue, but I have not found anything that would allow me to reproduce the same case that I had.

The situation is simple, I can do this:

$ touch example1.txt

but I can't do this:

$ touch example2.txt
touch: cannot touch 'example2.txt': No such file or directory

In this case, both example1.txt and example2.txt are files created via software, and we know that at some point the example2.txt file was probably created (the file names have a specific configuration formed by letters and numbers, without characters special spaces or blanks).

We are no longer able to obtain more information about the server that generated this situation (it is a client's server and we have already solved the situation in another way, creating another directory to store the files), but what I couldn't find out is what happened.

Even with root, we were unable to create the file (mkdir example2.txt, rm -rf example2.txt, result in the same error, ls -laF does not display the file).

The directory is shared via samba with Windows machines, and we think it might have something to do with it, but we tried in many ways to reproduce a similar case without success.

Now I'm really asking out of curiosity, because I tried to generate a similar situation and I couldn't.

Basically what I'm looking for is a way to reproduce the situation, and a way to resolve it (to deal with the situation in the software, if possible, or if not possible, then generate a log for the server administrator to resolve quickly).

In case anyone has any idea how to reproduce a similar situation, I would be grateful to share.

The directory was in /tmp/software_files, and we were able to create any file or directory inside, only the example2.txt file generated this situation.

  • Are example1.txt and example2.txt the actual names you used, or did you translate the real names for the sake of the question? If you did translate them, can you share the real name of example2.txt? Jul 4, 2020 at 3:41
  • 1
    yes they are examples only, the files follow a format like: ArchiveECD01012020.txt In this case what changes is just the date, ArchiveECD + ddmmyyyy.txt ArchiveECD01012020.txt - OK ArchiveECD01032020.txt - OK ArchiveECD01042020.txt - Fail ArchiveECD01092020.txt - OK
    – Bortoloso
    Jul 4, 2020 at 3:50
  • Did you ever got an solution? I'm facing this problem and will appreciate your help.
    – Dan Ortega
    Jun 26, 2021 at 16:22

1 Answer 1

mkdir test && cd test && rm -r ../test && touch fail; cd
touch: cannot touch 'fail': No such file or directory


touch other/fail
touch: cannot touch 'other/fail': No such file or directory

You could check for that but it's better to use a trap

if [ ! -d "$(pwd)" ] ; then echo fail; fi
  • Hello, thanks for the reply, but this would not be the case. The directory in question existed and it was possible to create any other files or directories in it, only one of the files (in this case, depending on the name of the file) has this problem.
    – Bortoloso
    Jul 4, 2020 at 3:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .