Re: How to delete directory someone created in my directory




JF Mezei wrote:
Christopher Lusardi wrote:
(1) Some one created a directory in my directory and I can not delete
it. I also cannot change the protections of the directory. How do I
delete it.


Ok, there are 3 issues here.

A properly created directory will be created with you as owner, but you
still cannot delete it by default.

A properly created directory may be yours, but you won't be allowed to
delete it if there are files inside.

An improperly created directory may belong to someone else, in which
case, you'll probably need the system manager to fix it.

1- Check onwership:

DIR/SECURITY mysubdir.dir

This will show if the directory file belongs to you or not. (normally
should).


2- Change protection of directory:

SET FILE mysubdir.dir/prot=(o:rwed)
(this lets you read/write/execute/delete the file)


SET FILE /PROTECTION and SET PROTECTION might still work, but they
have been superseded.

$ help set file /protection

SET

FILE

PROTECTION

/PROTECTION[=(ownership[:access][,...])]

This command has been superseded by the SET SECURITY/PROTECTION
command.



Emptying the directory is less user friendly:

SET FILE [.mysubdir...]*.dir/prot=(o:rwed)/log
this sets any subdirectories below to be deletable.

DELETE [.mysubdir...]*.*;* /log

This may generate errors if it tries to delete non-empty subdirectories.
You re-issue the above commands until all file and all subdirectories
have been deleted.

DIR [.mysubdir] should now yield an empty directory.

You shoud now be able to

DELE/LOG mysubdir.dir;*


BACKUP any files in those directories that you want to keep. Then delete
all the files you can in those directories - there may be other files
you don't own and therefore can't delete without additional help.

Find out who owns the directory to be deleted ( use DIR/OWNER )

Get that person to sign on and empty the directory in question
by deleting the remainder of the files that you could not delete,
and then have that person SET SECURITY/PROTECTION=O:RWED on the
directory in question, and then have that person DELETE it.

If desired, re-create that directory yourself, and load the files
you want back into it from the backup you did earlier.
See Help Backup /BY_OWNER to learn about setting the owner of
the restored files.

The system manager can set his/her priv's to do all this too, if you
are unable to contact the person who created the directory.

.. fred bach ..
.



Relevant Pages

  • Re: How to find total MB of a directory plus all subdirectories
    ... Nigel Henry wrote: ... named Sounds Library, this contains many subdirectories, which contain ... What command can I use to find out the disk space this directory is ... subdirectories are multi worded without any hyphens, ...
    (Fedora)
  • Re: Need some small help on shell script - delete old files
    ... command so that it does not search subdirectories past this directory ... Please look at my original script from the first message to this ... # this is sufficiently unique in the BKPPATH ... The find command shows all files in the directory and subdirectories. ...
    (comp.unix.shell)
  • Re: Need some small help on shell script - delete old files
    ... command so that it does not search subdirectories past this directory ... The find command shows all files in the directory and subdirectories. ... gzip of $FILENAME at the end is not necessary as far as I can tell ... I am running the script and have noticed that the file names have been ...
    (comp.unix.shell)
  • Re: Need some small help on shell script - delete old files
    ... command so that it does not search subdirectories past this directory ... The find command shows all files in the directory and subdirectories. ... I am using your script. ... recent dump is always left un-compressed with no .gz extension. ...
    (comp.unix.shell)
  • Re: How to delete directory someone created in my directory
    ... I also cannot change the protections of the directory. ... This will show if the directory file belongs to you or not. ... SET FILE mysubdir.dir/prot= ... This may generate errors if it tries to delete non-empty subdirectories. ...
    (comp.os.vms)