Home |
Function RTFCompactDir |
Function RTFCompactDirRTFCompactDir compacts a directory or all directories below a given directory: int RTFCompactDir(const char * DirName, DWORD Flags); ParametersDirNameName of the directory to compact. No other files on the same drive as the given directory may be open (unless flag RTF_CMPCT_READ_ONLY is specified). Otherwise, RTF_ACCESS_DENIED is returned. FlagsThe Flags parameter specifies further options. Zero or any combination of the following values may be specified:
return valueIf the function succeeds, it returns the number of recovered short directory entries, 32 bytes each. If the function fails, the return value is a negative error code. RTFCompactDir copies all used directory entries to the start of the directory and zeros out all slack space. If the slack space is larger than one cluster, the slack space is freed, reducing the allocated size of a directory. Note that this is the only way a directory can shrink (apart from removing it with RTFRemoveDir). It is recommended to use RTFCompactDir when a lot of files have been deleted or renamed in a directory to reduce its size.
|