New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RNFS.stat doesn't work on directories on Android #540
Comments
exacly same problem, and also moveFile got same error |
A sample stacktrace from logcat: W/System.err( 2875): com.rnfs.IORejectionException: EISDIR: illegal operation on a directory, read '/data/data/com.teach_elders_read/files/tasks' |
+1 |
Guys, any work around I am not able to fix this issue? |
I had the same problem with the Following the
Thus you can use this method to find files and directories in a folder. You can check for the name of the file or directory to find a specific one
|
I have tried in following way RNFS.exists(`${RNFS.CachesDirectoryPath}/TEST`).then((isExist)=>{
if(isExist){
RNFS.moveFile("/storage/emulated/0/Pictures/IMG_20181024_181202.jpg",`${RNFS.CachesDirectoryPath}/TEST`).then(console.log).catch(console.error)
}else{
RNFS.mkdir(`${RNFS.CachesDirectoryPath}/TEST`,).then((data)=>{
RNFS.moveFile("/storage/emulated/0/Pictures/IMG_20181024_181202.jpg",`${RNFS.CachesDirectoryPath}/TEST`).then(console.log).catch(console.error)
})
}
}) getting the same error |
you can try my fork https://github.com/hejile/react-native-fs , which fixes 3 bugs. BTW, this project is really buggy. |
@hejile a PR with fixes is always appreciated :) |
@hejile Please review my PR for this fix |
Hi, Did you found any solution for this error ? |
It seems you have no rights to read the directory "/storage/emulated/0/Pictures/" or it does not exists I think. |
@NeliHarbuzava But i have already granted user for External Read And Write Permission and i'm able to get all files inside these directories but not able to copy them |
BTW Am i request correct permission ? |
@NeliHarbuzava I managed to fixed it, it was silly mistake. Thanks or help though |
|
I created a normal file and a directory in
RNFS.ExternalStorageDirectoryPath
on Android, and appliedstat
on them respectively.The first line worked, but the second line threw an exception:
It seemed to me that I couldn't use
stat
on directories on Android.Version:
The text was updated successfully, but these errors were encountered: