Я использую response-native-fs для записи некоторого содержимого в файл
var path = RNFS.DocumentDirectoryPath + '/test.txt';
// write the file
RNFS.writeFile(path, 'Lorem ipsum dolor sit amet', 'utf8')
.then((success) => {
console.log('FILE WRITTEN!');
})
.catch((err) => {
console.log(err.message);
});
, он работал как положено, и я сделал readDir, чтобы увидеть путь к файлу
RNFS.readDir(RNFS.DocumentDirectoryPath)
.then((result) => {
console.log('GOT RESULT', result);
return Promise.all([RNFS.stat(result[0].path), result[0].path]);
})
.then((statResult) => {
if (statResult[0].isFile()) {
// if we have a file, read it
return RNFS.readFile(statResult[1], 'utf8');
}
})
.then((contents) => {
console.log(contents);
})
я вижу путь к файлу path: "/data/user/0/com.brixonapplication/files/test.txt"
, но при просмотре устройства не было файла Кто-нибудь сталкивался с этим или с какими-либо советами?