2011-02-10 18:19:11

by Andries Brouwer

[permalink] [raw]
Subject: Re: [BUG] Generic syscalls -- chmod vs. fchmodat

On Tue, Jan 25, 2011 at 09:45:15AM -0800, Roland McGrath wrote:

> the empty string has never been a valid relative pathname.

Hmm. I definitely recall otherwise.

The old Unix definition is that the empty string stands for "."
so that 'ls ""' means the same as 'ls .'
and 'ls /tmp/""' the same as 'ls /tmp/.'.

Let me try.

On a recent Linux system:

% ls -l ""
ls: cannot access : No such file or directory

On an old Unix system:

# ls -l ""
drwxr-xr-x 2 bin 1040 Jan 1 1970 bin
drwxr-xr-x 2 bin 352 Jan 1 1970 dev
drwxr-xr-x 2 bin 304 Aug 20 12:39 etc
...

Andries


2011-02-10 18:17:35

by Roland McGrath

[permalink] [raw]
Subject: Re: [BUG] Generic syscalls -- chmod vs. fchmodat

> On Tue, Jan 25, 2011 at 09:45:15AM -0800, Roland McGrath wrote:
>
> > the empty string has never been a valid relative pathname.
>
> Hmm. I definitely recall otherwise.
>
> The old Unix definition is that the empty string stands for "."
> so that 'ls ""' means the same as 'ls .'
> and 'ls /tmp/""' the same as 'ls /tmp/.'.

I'm aware of that. I was talking about Linux and POSIX.


Thanks,
Roland

2011-02-11 09:12:04

by Andreas Schwab

[permalink] [raw]
Subject: Re: [BUG] Generic syscalls -- chmod vs. fchmodat

Andries Brouwer <[email protected]> writes:

> and 'ls /tmp/""' the same as 'ls /tmp/.'.

/tmp/"" is not an empty file name, and it is indistinguishable from /tmp/ .

Andreas.

--
Andreas Schwab, [email protected]
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E
"And now for something completely different."