lkml.org 
[lkml]   [1996]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: rmdir system call
Nick Randell:

: I have some code which is calling rmdir and passing the directory name
: is with a trailing '/'.

: eg rmdir("/tmp/nick/")

: The system call is returning with 'ENOENT'.

: The same code works ok on other operating systems. (HPUX, IRIX, AIX ...)

: Like my last posting, which is right?

: If Linux is wrong, what can I do about it?

The last question is easy: remove this trailing slash.
Which is right is more tricky, since POSIX.1 contradicts
itself. The classical interpretation is that an empty
pathname refers to the current directory, so that
"/dir/" is equivalent to "/dir/.".
But POSIX explicitly forbids this use of empty names.
Nevertheless, the definition of `pathname' says:
If the pathname refers to a directory, it may also
have one or more trailing slashes.
Probably Linux should accept such filenames, and probably
you should not use them.

Andries


\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.035 / U:0.396 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site