[plug] Reply to Richard Henry
James Elliott
James.Elliott at wn.com.au
Sun May 5 14:42:57 WST 2002
Thanks Richard
You explained it very well and it does make sense now ... the concept that
deleting a file alters the directory file whereas modifying a file's
contents does not change the directory file.
Thanks very much.
Kind regards
James Elliott
Ravensthorpe Computers
ABN 34 305 232 710
Tel: 08 9838 1043
Fax: 08 9838 1049
Cell: 0428 39 6052
E-mail: James.Elliott at wn.com.au
Australia Post:
PO Box 228, Ravensthorpe WA 6346
----- Original Message -----
From: "Richard Henry" <r.henry at murdoch.edu.au>
To: <plug at plug.linux.org.au>
Sent: Sunday, May 05, 2002 2:23 PM
Subject: RE: [plug] Questions for information
>
> > > 1. How can you have permission to modify a file that you cannot
> > > delete.
> > >
> >
> > To create a file, delete a file or rename a file you need
> > write permission for the directory that it is in. To modify
> > file you need write permission for the file itself.
> >
>
> Just to add a bit: a directory is actually just a file. It contains an
> array of filename => inode, where the inode is (basically) an area of
memory
> where all the information about the file is, such as it's size,
permissions
> etc.
>
> If you have write permission on a file (lets call it X), you can modify
its
> contents. You do not need write permission to the directory itself to do
> this, because changing the contents of X doesn't change any of the
> information in the directory file - it still contains just the filename
and
> inode location, and these haven't changed.
>
> However, if you try to delete or rename the file, that of course requires
> write access to the directory file, because it needs to change the
filename
> to inode mapping (change the filename in the case of a rename, or remove
the
> entry in the case of a delete).
>
> Hope this makes sense,
> Rich.
>
>
>
More information about the plug
mailing list