itinance / itinance/react-native-fs

rmdir() should be used instead of unlink() for directories

Open
#1,252 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
5k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

According to the documentation, unlink can remove directories.
However, based on standard Linux behavior, unlink should only be used to remove files, not directories.

When attempting to delete a directory, `rmdir()` should be used for empty directories, and `rm()` with the `{ recursive: true }` option should be used for non-empty directories.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.