Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
that is also known as "null character", usually represented as '\0'. Is this a specific problem you are having? If so,what is the file name, and what program is giving the error?
that is also known as "null character", usually represented as '\0'. Is this a specific problem you are having? If so,what is the file name, and what program is giving the error?
Evo2.
I am with gcc. I am receiving the error that some file names are having disallowed zero byte characters !!! But I can not find any "\0" in any one of them !!!
It's probably another un-printable character. chrism is correct you should check the ASCII table. I find that most characters which are acceptable are between 0x20 and 0x7e. But certain other characters such as "\" and "/" typically will cause problems even if you are able to name a file using those characters, same for *, ", ', `, %, #, ... try to stick with letters and numbers and use either SPACE, UNDERSCORE, or MINUS to delineate between terms in your file name.
Traditionally on *nix, we never use space in filenames, even though its legal.
This is because the convention for programs is that space delineates a break between separate arguments.
Been working in *nix for many years and never seen a space in a filename for a file supplied by a *nix supplier.
Just about the same for anyone who has worked on *nix for any length of time; they don't put spaces.
Of course sometimes you have to deal with it eg MSWin sourced files, but when possible I replace with underscores before processing.
Just about the same for anyone who has worked on *nix for any length of time; they don't put spaces.
I started on UNIX in '91 and use spaces liberally in file names; the only consideration is whether they improve legibility (for humans).
I take the view that UNIX was designed with any character except "\" legitimate in a pathname component and only NUL impracticable to use -- so we are free to make the most of them
Yeah, I don't do spaces or special chars, just use either dash or underscore. You pretty much have to de-limit all chars from the top row of the keyboard with backslash if you use them in a name, plus we all got used to typing underscore over the years.
@sryzdn
Did you get your question answered/problem resolved? If not, it would make sense to cut/paste in brackets the errors you're receiving when you try compiling.
It is possibly not a "unprintable" character as it is possible for a non-ascii character to be put in (these are two or three byte characters, and sometimes a null byte can be part of them).
But I can not find any "\0" in any one of them !!!
How are you looking for them? Most standard commandline tools don't have a way to print unprintable characters, so they show up differently on your terminal than you might expect them to. To truly see what bytes compose your filenames, I suggest using opendir() & readdir() to acquire filenames. Using this, you can then print the filenames using some code to print each individual byte in the filename using some always-printable format such as hexadecimal notation. As I understand it, blackhat hackers have used techniques such as embedding unprintable characters in filenames to conceal the presence of undesirable files, which works if the viewer of said filenames cannot reveal the true filename strings.
The readdir() man page says that the filename is supposed to be null-terminated, so effectively this rules out embedded nulls as part of the filename. Curiously, however, there is a field in struct dirent described as 'unsigned short d_reclen;', which kind of suggests that some filesystem type may allow for embedded nuls, and use the d_reclen field to describe the filename length.
How are you looking for them? Most standard commandline tools don't have a way to print unprintable characters, so they show up differently on your terminal than you might expect them to. To truly see what bytes compose your filenames, I suggest using opendir() & readdir() to acquire filenames. Using this, you can then print the filenames using some code to print each individual byte in the filename using some always-printable format such as hexadecimal notation. As I understand it, blackhat hackers have used techniques such as embedding unprintable characters in filenames to conceal the presence of undesirable files, which works if the viewer of said filenames cannot reveal the true filename strings.
The readdir() man page says that the filename is supposed to be null-terminated, so effectively this rules out embedded nulls as part of the filename. Curiously, however, there is a field in struct dirent described as 'unsigned short d_reclen;', which kind of suggests that some filesystem type may allow for embedded nuls, and use the d_reclen field to describe the filename length.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.