Previous section.

Protocols for Interworking: XNFS, Version 3W
Copyright © 1998 The Open Group

Name

NFSPROC3_RMDIR - Remove a Directory

Call Arguments

struct RMDIR3args { diropargs3 object; };

Return Arguments

struct RMDIR3resok { wcc_data dir_wcc; };

struct RMDIR3resfail { wcc_data dir_wcc; };

union RMDIR3res switch (nfsstat3 status) { case NFS3_OK: RMDIR3resok resok; default: RMDIR3resfail resfail; };

RPC Procedure Description

RMDIR3res NFSPROC3_RMDIR(RMDIR3args) = 13;

Description

Procedure RMDIR removes (deletes) a subdirectory from a directory. If the directory entry of the subdirectory is the last reference to the subdirectory, the subdirectory may be destroyed.

On entry, the arguments in RMDIR3args are:

object
A diropargs3 structure identifying the directory entry to be removed:

dir
The file handle for the directory from which the subdirectory is to be removed.

name
The name of the subdirectory to be removed. See General File Name Requirements for more information on file names.

Upon successful return, RMDIR3res.status is NFS3_OK and RMDIR3res.resok contains:

dir_wcc
Weak cache consistency data for the directory object.dir. For a client that requires only the post-.IR RMDIR directory attributes, these can be found in dir_wcc.after.

Otherwise, RMDIR3res.status contains the error on failure and RMDIR3res.resfail contains the following:

dir_wcc
Weak cache consistency data for the directory object.dir. For a client that requires only the post-.IR RMDIR directory attributes, these can be found in dir_wcc.after.

Note that even though the RMDIR failed, full wcc_data is returned to allow the client to determine whether the failing RMDIR changed the directory.

Implementation Guidance

Note that on some servers, removal of a non-empty directory is disallowed.

On some servers, the filename "." is invalid. These servers will return the NFS3ERR_INVAL error. On some servers, the filename ".." is invalid. These servers will return the NFS3ERR_EXIST error. This would seem inconsistent, but allows these servers to comply with their own specific interface definitions. Clients must be prepared to handle both cases.

The client should not rely on the resources (disk space, directory entry and so on) formerly associated with the directory becoming immediately available.

Return Codes

NFS3ERR_NOENT
No such file or directory. The file or directory name specified does not exist.

NFS3ERR_IO
I/O error. Some sort of hard error occurred when the operation was in progress. This could be a disk error, for example.

NFS3ERR_ACCES
Permission denied. The caller does not have the correct permission to perform the requested operation. Contrast this with NFS3ERR_PERM, which restricts itself to owner permission failures.

NFS3ERR_INVAL
Invalid argument or unsupported argument for an operation. Two examples are attempting a READLINK on an object other than a symbolic link or attempting to SETATTR a time field on a server that does not support this operation.

NFS3ERR_EXIST
File exists. The file specified already exists.

NFS3ERR_NOTDIR
Not a directory. The caller specified a non-directory in a directory operation.

NFS3ERR_NAMETOOLONG

The filename in an operation was too long.

NFS3ERR_ROFS
Read-only file system. A modifying operation was attempted on a read-only file system.

NFS3ERR_NOTEMPTY

An attempt was made to remove a directory that was not empty.

NFS3ERR_STALE
Invalid file handle. The file handle given in the arguments was invalid. The file referred to by that file handle no longer exists or access to it has been revoked.

NFS3ERR_BADHANDLE

Invalid NFS file handle. The file handle failed internal consistency checks.

NFS3ERR_NOTSUPP

The operation is not supported.

NFS3ERR_SERVERFAULT

An error occurred on the server, which does not map to any of the valid NFS Version 3 protocol error values. The client should translate this into an appropriate error. Clients based on an XPG system may choose to translate this to EIO.


Why not acquire a nicely bound hard copy?
Click here to return to the publication details or order a copy of this publication.

Contents Next section Index