RmDir

Description:              This function destroys a directory on a disk and returns its own error code.

Returns:                    Numeric

Usage:                       Script

Format:                      RmDir(Name [, DelAll])

Parameters:             Name   { text }  { required }  { no default: }

                                      Any text expression that is the full path name of the directory to delete.

                                    DelAll   { numeric }  { optional }  { default: 0 }

                                      An optional parameter which, when set to 1, causes all files and subdirectories of the named directory to be deleted.  Default: 0

Comments:               The return value is 0 if successful and -1 otherwise. 

Note that if DelAll is not set to 1 and if the directory contains files or subdirectories, then the directory will not be deleted.

                                    If Name is given as a relative path, then VTS will look for that directory starting in whatever directory holds the module that is making the RmDir call.  Thus RmDir("Sample");  run from within an application that is located in the directory C:\VTS\MyApp, will remove the directory C:\VTS\MyApp\Sample. 

                             Note that this behavior differs from that of the MkDir function.

Example:

err = RmDir("C:\Sample");

If possible (permissions permitting), directory Sample on the C drive will be deleted and err will be set to 0; if unsuccessful, err will be -1.

See Also:

MkDir