joltup / rn-fetch-blob

A project committed to making file access and data transfer easier, efficient for React Native developers.
MIT License
2.81k stars 773 forks source link

Double slashes in filesystem paths on iOS #502

Open flashman2 opened 4 years ago

flashman2 commented 4 years ago

Filesystem functions works fine on Androi, but on iOS there is a problem: Try to list files in dir with lstat: RNFetchBlob.fs .lstat(sourceDir) .then(filesObjList => { console.log('fileManager filesList:' + JSON.stringify(filesObjList));

Then I see in console double slashes in files paths like this: [{"size":"20480","path":"/Users/user/Library/Developer/CoreSimulator/Devices/XXXXX/data/Containers/Data/Application/YYYYY/Documents/content/Content01/Subcontent//.index.html.swp","filename":".index.html.swp","lastModified":1571680744000,"type":"file"},

You can see double slashes before .index.html.swp file. All other files and dirs in this dir also have double slashes in paths!

MacOS Mojave, "react-native": "0.61.5" "rn-fetch-blob": "^0.11.2"

Because of this bug, file copying works with bugs on iOS if use files paths from lstat()!