On Sun, Sep 14, 2014 at 9:32 AM, Edward Ned Harvey (lopser)
<[email protected]> wrote:
> But I'm running OSX.   ;-)   All unicode characters are allowed, including 
> NUL.  (Although many applications will impose their own restrictions.)
>
> And in btrfs, '/' is disallowed (in addition to \0).   And in extfs, \0, '/', 
> "." and ".." are disallowed...

I stand corrected about '/'.  \0 and '/' are disallowed by the POSIX spec.

However your other claims don't have a lot of evidence to back them up.

Trying to create a file with \0 in it:

I tried using this script.  It fails. The result is a fill called
"abcd" since the open() call stops reading the filename at the \0:

#!/usr/bin/perl
use strict;
use warnings;
 my $filename = "abcd\0fg.txt";
open(my $fh, ">", $filename) or die "cannot create file $!";
print $fh "This is sample text.\n";
close $fh;

Trying to create a file with '/' in it:

If I use the MacOSX finder to manually create a file with a "/" in it,
I get a ":" in that place, because the '/' is not allowed in the
filename.

$ ls -lad t*
drwxr-xr-x  2 tal  staff  68 Sep 14 09:46 this : test

So how does Finder know to display a '/' instead of a ':'?  It stores
the display name in the meta data:

$ mdls -name kMDItemDisplayName this\ \:\ test/
kMDItemDisplayName = "this / test"

So, in both cases it seems that I'm unable to verify your result.

> Basically, the posix spec doesn't matter as every actual filesystem deviates 
> from it.

While some file systems to break POSIX semantics in other areas, I
know of no file systems that claims POSIX compatibility that breaks
the rule about \0 and '/'.

Could you write a program that creates a file with either of those
chars?   I'd really like to see this.

Tom

-- 
Email: [email protected]    Work: [email protected]
Skype: YesThatTom
Blog:  http://EverythingSysadmin.com
_______________________________________________
Tech mailing list
[email protected]
https://lists.lopsa.org/cgi-bin/mailman/listinfo/tech
This list provided by the League of Professional System Administrators
 http://lopsa.org/

Reply via email to