bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #62561] "files0-from" expression prints "find: '\n' No such file or


From: Bernhard Voelker
Subject: [bug #62561] "files0-from" expression prints "find: '\n' No such file or directory "
Date: Thu, 2 Jun 2022 13:13:28 -0400 (EDT)

Update of bug #62561 (project findutils):

                  Status:                    None => Working as Intended    
             Assigned to:                    None => berny                  
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #1:

Thanks for the report and the patch.

I'm afraid it's not a bug or something to fix or handle in find,
but rather a misunderstanding on your side how -files0-from
works.

The only valid entry separator in the input from -files0-from
is the NUL character.  This is intentional to allow arbitrary
input.

E.g. it is allowed and fully okay to have a file named '\n':

$ echo hello > '\n'

$ cat '\n'
hello

$ rm -v '\n'
removed '\n'


P.S. editors like vim usually handle text files, and POSIX
says that text files must end on a newline.
Therefore, it's not good to edit the binary input for -files0-from
with a text editor, because they change the end of the file:


$ printf '/home\0' > startpoint.txt

$ od -tx1z startpoint.txt
0000000 2f 68 6f 6d 65 00                                >/home.<
0000006

# Edit the file with a text editor and save it.
$ vi startpoint.txt

$ od -tx1z startpoint.txt
0000000 2f 68 6f 6d 65 00 0a                             >/home..<
0000007

See the trailing newline.

Therefore, I'm closing this as 'works as intended'.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?62561>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]