From Ted.Harding at manchester.ac.uk  Fri Sep 18 23:35:37 2009
From: Ted.Harding at manchester.ac.uk ( (Ted Harding))
Date: Fri, 18 Sep 2009 22:35:37 +0100 (BST)
Subject: [Rd] basename returns "." not in filename (PR#13958)
In-Reply-To: <1367267789@web.de>
Message-ID: <XFMail.090918223537.Ted.Harding@manchester.ac.uk>

On 18-Sep-09 19:08:15, Jens Oehlschl?gel wrote:
> Mmh,
>> > Point is, I gather, that trailing slashes are removed, e.g.,
>> >
>> > viggo:~/>basename foo/
>> > foo
>> >
>> > So, not a bug.
> 
> This unfortunately means that we cannot distinguish between 
> 1) a path with a filename
> 2) a path without a filename
> 
> For example in the next version of the ff-package we allow a user to
> specify a 'pattern' for all files of a ff dataframe which is path
> together with a fileprefix, the above means we cannot specify an empty
> prefix "" for the current working directory, because 
> 
>> dirname("./.")
> [1] "."
>> basename("./.")
> [1] "."
>> dirname("./")
> [1] "."
>> basename("./")
> [1] "."
> 
> Jens Oehlschl?gel

I am getting confused by this discussion. At least on Unixoid systems,
and I believe it holds for Windows systems too, "." stands for the
current directory ("working directory").

Moreover, "./" means exactly the same as ".": If you list the files
in "./" you will get exactly the same as if you list the files in ".".

Further, "<any directory>/." means the same as "<any directory>/"
and the same as "<any directory>", so (on the same basis) "./." also
means exactly the same as ".".

Therefore the second "." in "./." is not a filename.

What the above examples of dirname and basename usage are returning
is simply a specific representation of the current working directlory.

Forgive me if I have not seen the point, but what I think I have seen
boils down to the interpretation I have given above.

Best wishes,
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk>
Fax-to-email: +44 (0)870 094 0861
Date: 18-Sep-09                                       Time: 22:35:34
------------------------------ XFMail ------------------------------



[Rd] basename returns "." not in filename (PR#13958)
 (Ted Harding