rmdirhelper Function

Microchip MDD File System Interface

MDDFS Interface Library Help
rmdirhelper Function
C
int rmdirhelper(
    BYTE mode, 
    char * ramptr, 
    const rom char * romptr, 
    unsigned char rmsubdirs
);
Description

This helper function is used by the FSmkdir function. If the path argument is specified in ROM for PIC18 this function will be able to parse it correctly. This function will first change to the specified directory. If the rmsubdirs argument is FALSE the function will search through the directory to ensure that it is empty and then remove it. If the rmsubdirs argument is TRUE the function will also search through the directory for subdirectories or files. When the function finds a file, the file will be erased. When the function finds a subdirectory, it will switch to the subdirectory and begin removing all of the files in that subdirectory. Once the subdirectory is empty, the function will switch back to the original directory. return to the original position in that directory, and continue removing files. Once the specified directory is empty, the function will change to the parent directory, search through it for the directory to remove, and then erase that directory.

Preconditions

This function should not be called by the user.

Parameters
Parameters 
Description 
path 
The path of the dir to delete 
rmsubdirs 
  • TRUE - Remove all sub-directories and files in the directory
  • FALSE - Non-empty directories can not be removed

 

Return Values
Return Values 
Description 
The specified directory was successfully removed. 
EOF 
The specified directory could not be removed. 
Side Effects

The FSerrno variable will be changed.

Remarks

None.

Microchip MDD File System Interface 1.2.0 - [Aug 18, 2008]
Copyright © 2008 Microchip Technology, Inc.  All rights reserved.