VirtualBox

Changeset 27246 in vbox for trunk/include/iprt


Ignore:
Timestamp:
Mar 10, 2010 12:51:15 PM (15 years ago)
Author:
vboxsync
Message:

RTDirRemoveRecursive: Fixed memory leak, made it deal with UNKNOWN and thus work on Linux, optimized stack usage, added flag for only removing the content of the specified directory. TXS: clean up the scratch directory.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/dir.h

    r25292 r27246  
    103103 *
    104104 * @returns iprt status code.
    105  * @param   pszPath   Path to the directory to remove.
     105 * @param   pszPath         Path to the directory to remove.
    106106 */
    107107RTDECL(int) RTDirRemove(const char *pszPath);
     
    111111 *
    112112 * @returns iprt status code.
    113  * @param   pszPath   Path to the directory to remove recursively.
    114  */
    115 RTDECL(int) RTDirRemoveRecursive(const char *pszPath);
     113 * @param   pszPath         Path to the directory to remove recursively.
     114 * @param   fFlags          Flags, see RTDIRRMREC_F_XXX.
     115 */
     116RTDECL(int) RTDirRemoveRecursive(const char *pszPath, uint32_t fFlags);
     117
     118/** @name   RTDirRemoveRecursive flags.
     119 * @{ */
     120/** Only delete the content of the directory, omit the directory it self. */
     121#define RTDIRRMREC_F_CONTENT_ONLY   RT_BIT_32(0)
     122/** Mask of valid flags. */
     123#define RTDIRRMREC_F_VALID_MASK     UINT32_C(0x00000001)
     124/** @} */
    116125
    117126
     
    184193{
    185194    /** The unique identifier (within the file system) of this file system object (d_ino).
     195     *
    186196     * Together with INodeIdDevice, this field can be used as a OS wide unique id
    187      * when both their values are not 0.
    188      * This field is 0 if the information is not available. */
     197     * when both their values are not 0.  This field is 0 if the information is not
     198     * available. */
    189199    RTINODE         INodeId;
    190200    /** The entry type. (d_type)
    191      * RTDIRENTRYTYPE_UNKNOWN is a legal return value here and
    192      * should be expected by the user. */
     201     * RTDIRENTRYTYPE_UNKNOWN is a common return value here since not all file
     202     * systems (or Unixes) stores the type of a directory entry and instead
     203     * expects the user to use stat() to get it.  So, when you see this you
     204     * should use RTPathQueryInfo to get the type, or if if you're lazy, use
     205     * RTDirReadEx. */
    193206    RTDIRENTRYTYPE  enmType;
    194     /** The length of the filename. */
     207    /** The length of the filename, excluding the terminating nul character. */
    195208    uint16_t        cbName;
    196209    /** The filename. (no path)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette