in reply to Re: How do I know if I can delete a file/folder?
in thread How do I know if I can delete a file/folder?
Sorry grep I had to down vote your node because at worse is just wrong and at best its misleading.
If you are in a modern version of linux it's easyWhat does 'modern linux' mean? The basic operation of *nix file permission and ownership mechanisms have been around since before my beard started turning grey.
To delete a file (in a directory you can get to) you must have write permissions for that directory.Not complete, you must also have write permissions on the file. What if the directory is 777 but he file is 644 and owned by root or file is owned by you and is 444? Try this:
Prologue drwxrwxrwx 2 mitd mitd 4096 Jul 26 02:36 testdir -r--r--r-- 1 mitd mitd 0 Jul 26 02:36 testdir/myfile perl -e 'open(FILE,">myfile") or die $!'
For a more OS independant solution copy the file (cp -p) to a backup file then delete the original'OS' dependent true but then you quote a *nix dependent command with no regard to what the ownership permissions conditions might be,
mitd-Made in the Dark
'Interactive! Paper tape is interactive!
If you don't believe me I can show
you my paper cut scars!'
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: How do I know if I can delete a file/folder?
by greenFox (Vicar) on Jul 26, 2002 at 09:04 UTC | |
Re: Re: Re: How do I know if I can delete a file/folder?
by aersoy (Scribe) on Jul 26, 2002 at 14:22 UTC | |
Re: Re: Re: How do I know if I can delete a file/folder?
by gmpassos (Priest) on Jul 26, 2002 at 08:15 UTC |
In Section
Seekers of Perl Wisdom