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 - isdir() return if the specified directory exist http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 isdir()             Return if the specified directory exist
------------------------------------------------------------------------------
 Declaration
   file.hdr

 Syntax
   func logical isdir extern
   param const char cDirectory

 Arguments
   cDirectory is the directory to check for existence.

 Return
   A logical indicating if the directory exists.

 Description
   This function checks if the specified directory exists. cDirectory may
   contain a drive identifier; it must not end with a backslash.

 Example
   #define EXAMPLE_FILE
   #include example.hdr

   // Create a directory if it does not exist
   
   proc Test_isdir
   vardef
      char cDir
   enddef
   cDir := "testing"                // set directory name
   if .not. isdir( cDir )           // if directory does not exist
      mkdir( cDir )                 // create directory
      ? isdir( cDir )               // print .t. if successful
      if isdir( cDir )              // if directory created
         rmdir( cDir )              // remove directory
      endif
   endif
   endproc

   proc main
   Test_isdir()
   endproc

See Also: chdir() isdrive()

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