react-native-fs
react-native-fs copied to clipboard
rmdir() should be used instead of unlink() for directories
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.