Changeset cd0dce3 in mainline for uspace/lib/fmgt/src/fsops.c


Ignore:
Timestamp:
2026-02-11T23:17:49Z (18 hours ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Parents:
f9c30b9a
Message:

Create new directory (Navigator + command line utility).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/fmgt/src/fsops.c

    rf9c30b9a rcd0dce3  
    135135 * @param fmgt File management object
    136136 * @param dname Directory name
    137  * @return EOK on success or an error code
    138  */
    139 errno_t fmgt_create_dir(fmgt_t *fmgt, const char *dname)
     137 * @param exclusive If @c true, directory must not exist.
     138 * @return EOK on success or an error code
     139 */
     140errno_t fmgt_create_dir(fmgt_t *fmgt, const char *dname, bool exclusive)
    140141{
    141142        fmgt_io_error_t err;
     
    146147                rc = vfs_link_path(dname, KIND_DIRECTORY, NULL);
    147148
    148                 /* It is okay if the directory exists. */
    149149                if (rc == EOK || rc == EEXIST)
    150150                        break;
     
    160160        } while (action == fmgt_er_retry);
    161161
    162         if (rc == EEXIST)
     162        if (rc == EEXIST && !exclusive)
    163163                return EOK;
    164164
Note: See TracChangeset for help on using the changeset viewer.