| **Navigation:**  [[advanced topics 1.htm|Advanced Topics]] > Clarion Language Utilities >====== RemoveDirectory (Remove a directory) ====== | [[putreg write value to windows registry .htm|{{btn_prev_n.gif|Previous page}}]][[advanced topics 1.htm|{{btn_home_n.gif|Return to chapter overview}}]][[resizeimage resize an image to fit a control .htm|{{btn_next_n.gif|Next page}}]] | | || **REMOVEDIRECTORY( **//directoryname// **)** {{blk2blue.jpg|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 create a directory .htm|CreateDirectory]]