User Tools

Site Tools


removedirectory_remove_a_directory_.htm
Navigation:  Advanced Topics > Clarion Language Utilities >====== RemoveDirectory (Remove a directory) ====== Previous pageReturn to chapter overviewNext page

REMOVEDIRECTORY( directoryname )

blk2blue.jpg

REMOVEDIRECTORY Remove an existing directory
directoryname A string constant or variable that stores the directory name

REMOVEDIRECTORY removes an existing directory with the name passed in the directoryname parameter. REMOVEDIRECTORY returns zero (0) if successful, and non-zero if not. You can query the ERRNO built-in library function to trap for the following error codes:

3 ' Path not found (One of the higher path components in directoryname)

5 ' Access Denied (Path may refer to a file, root directory, or current directory)

To add support for this utility to your existing applications, you need only include the CWUTIL.INC file in the Global Map section of your program:

INCLUDE('CWUTIL.INC'),ONCE

Return Data Type:     BYTE

Example:

 MODULE('')

   errno(),*SIGNED,NAME('errno')   !proptotype built-in error flag

 END

IF REMOVEDIRECTORY(GLO:NewDirectoryName)

CASE Errno()

OF 3

 MESSAGE('Path Not Found')

OF 5

 MESSAGE('Access Denied')

END

END

See Also:

CreateDirectory

removedirectory_remove_a_directory_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1