On Thursday 03 January 2008 07:13, Kalvin Weng wrote:
You can use the command unlink .....I think.
No. That's something different. The "unlink" command provides direct access to
the unlink() system call. It is what the "rm" and "rmdir" commands ultimately
call, but with some safeguards on the way. The "unlink" command is not
intended for general use; use "rm" or "rmdir" instead.
Both the "unlink" command and the unlink() system call deal with hard
links(!). They don't know anything about symlinks. To the system, each file
or directory is identified with an "i-node" which has an "i-number". File
names and directory paths are just there for us mere mortals who have a hard
time remembering 32 bit i-numbers to identify a file or directory. ;-)
http://en.wikipedia.org/wiki/Inode
http://en.wikipedia.org/wiki/Hard_link
http://en.wikipedia.org/wiki/Symbolic_link
From "info unlink":
"12.8 `unlink': Remove files via the unlink syscall
==================================================
`unlink' deletes a single specified file name. It is a minimalist
interface to the system-provided `unlink' function. *Note Deleting
Files: (libc)Deleting Files. Synopsis: It avoids the bells and
whistles of the more commonly-used `rm' command (*note rm invocation::).
unlink FILENAME
On some systems `unlink' can be used to delete the name of a
directory. On others, it can be used that way only by a privileged
user. In the GNU system `unlink' can never delete the name of a
directory.
..."
From "man 2 unlink":
"NAME
unlink - delete a name and possibly the file it refers to
SYNOPSIS
#include