Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Commit 218c02c

Browse files
committed
Add system dirs to Android native
1 parent a2971c0 commit 218c02c

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

src/fs.js

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,26 @@ function getSystemDirs() {
3535
return new Promise((resolve, reject) => {
3636
try {
3737
RNFetchBlob.getEnvironmentDirs((...dirs) => {
38-
let [DocumentDir, CacheDir, DCIMDir, DownloadDir] = [...dirs]
39-
resolve({DocumentDir, CacheDir, DCIMDir, DownloadDir})
38+
let [
39+
DocumentDir,
40+
CacheDir,
41+
// Android only
42+
DCIMDir,
43+
DownloadDir,
44+
PictureDir,
45+
MusicDir,
46+
MovieDir,
47+
RingToneDir] = [...dirs]
48+
resolve({
49+
DocumentDir,
50+
CacheDir,
51+
DCIMDir,
52+
DownloadDir,
53+
PictureDir,
54+
MusicDir,
55+
MovieDir,
56+
RingToneDir
57+
})
4058
})
4159
} catch(err) {
4260
reject(err)
@@ -182,6 +200,10 @@ function mv(path:string, dest:string):Promise<boolean> {
182200
})
183201
}
184202

203+
function lstat(path:string):Promise<Array<RNFetchBlobFile>> {
204+
205+
}
206+
185207
function ls(path:string):Promise<Array<String>> {
186208
return new Promise((resolve, reject) => {
187209
RNFetchBlob.ls(path, (err, res) => {
@@ -255,5 +277,8 @@ export default {
255277
writeStream,
256278
exists,
257279
createFile,
258-
isDir
280+
isDir,
281+
stat,
282+
lstat,
283+
scanFile
259284
}

0 commit comments

Comments
 (0)