Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - rmdir() remove a directory http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 rmdir()             Remove a directory
------------------------------------------------------------------------------
 Declaration
   file.hdr

 Syntax
   func logical rmdir extern
   param const char cDirectory

 Arguments
   cDirectory is the name of the directory to remove.

 Return
   A logical indicating the success of operation.

 Description
   The rmdir() function attempts to remove the directory cDirectory and
   returns .t. if the attempt was successful. The specified directory
   must be empty. If a full path is specified, only the child directory
   is removed, not the parent.

 Example
   #define EXAMPLE_FILE
   #include example.hdr

   proc Test_rmdir
   vardef
      char cDir
   enddef
   cDir := "testing"                // set directory name
   if .not. isdir( cDir )           // if directory does not exist
      mkdir( cDir )                 // create directory
      if isdir( cDir )              // if directory created
         rmdir( cDir )              // remove directory
         ? "Directory", cDir, "created and removed"
      endif
   endif
   endproc

   proc main
   Test_rmdir()
   endproc

See Also: chdir() isdir() mkdir()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson