0
我嘗試使用IONIC2編寫日誌文件,似乎所有工作,而不是錯誤,與IONIC2文件存在目錄創建,但我無法用文件資源管理器查看文件。見我的消息來源有:IONIC2與外部數據目錄上的cordova-plugin-file該文件不可見與文件管理器
File.checkDir(cordova.file.externalDataDirectory, 'mydir')
.then(_ => {
trace.info('yay')
})
.catch(err => {
trace.error('BackgroundGeolocationService','constructor',`boooh`);
File.createDir(cordova.file.externalDataDirectory, "mydir", false)
.then(function (success) {
// success
trace.info('create mydir success');
}, function (error) {
// error
trace.error('BackgroundGeolocationService','constructor',`unable to create mydir`);
}.bind(this));
});
File.createFile(cordova.file.externalDataDirectory, "new_file.txt", true)
.then(function (success) {
// success
trace.info('write file success');
}, function (error) {
// error
trace.error('BackgroundGeolocationService','constructor',`error:${error}`)
});
我在我的手機的每個目錄中查看文件和目錄不存在。 –
現在嘗試使用externalRootDirectory。它應該只出現在設備的根目錄中。只是想看看它是否是查看文件夾的權限問題,而不是文件沒有實際寫入的問題。 –
我在移動設備上的文件管理器上看到創建的文件「new_file.txt」和目錄「mydir」,但通過Windows文件瀏覽器無法在我的電腦上看到! –