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

Jens Oehlschlägel joehl at web.de
Fri Sep 18 21:08:15 CEST 2009


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



More information about the R-devel mailing list