PROCEDURE MakeDir( dir: Dir; path: PathName; mode: FileMode; euser: User := NIL) RAISES {Error}; (* NotSuperUserEC, PathES, FileExistsEC, FailureES? *)
MakeDir creates an empty directory with the specified path name. MakeDir
creates at most one directory: it raises LookUpEC if one of the
intermediate components in the specified path name does not exist. It
raises FileExistsEC if there is an existing directory entry with that path
name. MakeDir sets the file mode of the new directory to the specified
file mode, adjusted using the value of the umask (see the GetUMask procedure
on page ); normally the caller should specify a mode of
ReadWriteExecuteAll.
MakeDir interprets the euser parameter the same way Open does.
PROCEDURE RemoveDir( dir: Dir; path: PathName := NIL; euser: User := NIL) RAISES {Error}; (* NotSuperUserEC, PathES, DirectoryNotEmptyEC, FileBusyEC, FailureES? *)
RemoveDir deletes the directory with the specified path name and also
deletes the entry for that directory from its parent directory. It raises
NotADirectory if the specified path doesn't name a directory, or
DirectoryNotEmptyEC if the directory to be deleted contains anything other
than the . and .. entries. It raises FileBusyEC if the directory is the
root directory of a logical volume, or if there is another logical volume
mounted on top of the directory. (Mounting volumes is described in
section 2.7, page , and Appendix
A.5, page
.)
Once a directory has been deleted, an attempt to use an old directory handle for it raises LookUpEC.
RemoveDir interprets the euser parameter the same way Open does.
PROCEDURE SymLink( fromDir: Dir; from: PathName; to: PathName; euser: User := NIL) RAISES {Error}; (* NotSuperUserEC, PathES, FileExistsEC, FailureES? *)
SymLink creates a symbolic link with the path name specified by from and
fromDir; it raises FileExistsEC if the path name is already in use. The
content of the link is set to the value of the `to' parameter, without any
checking or evaluation performed on it. The use of symbolic links in the
file name space is described on page .
SymLink interprets the euser parameter the same way Open does.
Ultrix note: SymLink raises NameTooLongEC if the `to' parameter is longer than 255 characters.
PROCEDURE HardLink( oldDir: Dir; oldPath: PathName; newDir: Dir; newPath: PathName; euser: User := NIL) RAISES {Error}; (* NotSuperUserEC, PathES, FileExistsEC, CannotLinkToDirectoryEC, CrossDeviceLinkEC, FailureES? *)
HardLink creates a new directory entry with the path name specified by newPath and newDir that refers to the same file link as does the path name specified by oldPath and oldDir. It raises FileExistsEC if the new path name is already in use, CannotLinkToDirectoryEC if the old path name is that of a directory, or CrossDeviceLinkEC if the new path name lies in a different logical volume than the old one.
Once the link is made, the new and old links are equivalent with respect to all the file system operations.
HardLink interprets the euser parameter the same way Open does.
PROCEDURE Remove( dir: Dir; pathName: PathName; euser: User := NIL) RAISES {Error}; (* NotSuperUserEC, PathES, DirectoryUnlinkEC *)
Remove deletes the directory entry with the specified path name. This must be an entry created by Open, SymLink, OSFriends.MakeDevice, or HardLink; Remove raises raises DirectoryUnlinkEC if the entry is for a directory.
The entry is removed from the directory immediately. If it refers to a file, the file is not deleted from the disk until no other directory entries (hard links) or open-file objects refer to it. If entry refers to a symbolic link, the link is deleted but the object to which the link referred (if any) is not affected.
Remove interprets the euser parameter the same way Open does.
PROCEDURE Rename( oldDir: Dir; oldPath: PathName; newDir: Dir; newPath: PathName; euser: User := NIL) RAISES {Error}; (* NotSuperUserEC, PathES, CrossDeviceLinkEC, DirectoryUnlinkEC, DirectoryNotEmptyEC, InvalidArgumentEC, FailureES? *)
Rename moves a file or directory `atomically' from one directory to another. Rename guarantees that the operation is atomic with respect to concurrent operations, and with respect to system crashes.
When the old path name specifies a file, Rename requires either that the new path name specifies a file, or that it is nonexistent. When the old path name specifies a directory, Rename requires either that the new path name specifies an empty directory (excluding . and ..), or that it is nonexistent. Rename raises DirectoryUnlinkEC if the old path name specifies a file and the new path specifies an existing directory, or vice versa. Rename raises DirectoryNotEmptyEC if the old path name specifies a directory and the new path name specifies an existing non-empty directory. Rename raises CrossDeviceLinkEC if the new path name is in a different logical volume than the old path name. Rename raises InvalidArgumentEC if the operation would put a cycle into the file system, e.g., renaming /a as /a/b.
Rename interprets the euser parameter the same way Open does.
Taos note: if the system crashes while a file is being renamed, the file will not be lost, but it may be referred to by both the old and new path names, or there may be an extra reference count on the file. The first problem is not detected; the second can be detected and fixed by the scavenger (but will not cause any harm). If a directory is being renamed, the operation will either complete or will be backed out by a forced run of the scavenger when the system reboots.