in reply to Re: Parsing a directory
in thread Parsing a directory

Just a quick question to verify my thinking with respect to pre-pending the parent directory. I think I found an exception to this rule. If the parent is the root directory (/) then it is a special case because I get //somefile.name. Correct?

Replies are listed 'Best First'.
Re^3: Parsing a directory
by pc88mxer (Vicar) on Jun 29, 2008 at 01:51 UTC
    No - that case is no different. The values returned by readdir() will not contain any leading slash. Just try it:
    opendir(D, "/"); for (readdir(D)) { print "got: $_\n" } closedir(D);