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

Commit 2cc625c

Browse files
committed
Update README.md
1 parent 29417d3 commit 2cc625c

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

README.md

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,11 @@ Here's the list of `fs` APIs
361361
- cp
362362
- exists
363363
- isDir
364+
- lstat
365+
- stat
366+
- scanFile (Android Only)
364367

365-
See [fs](#user-content-fs) chapter for more information
368+
See [fs chapter](#user-content-fs) for more information
366369

367370
#### File Stream
368371

@@ -399,15 +402,17 @@ RNFetchBlob.readStream(
399402
When use `writeStream`, the stream is also opened immediately, but you have to `write`, and `close` by yourself.
400403

401404
```js
402-
let ofstream = RNFetchBlob.writeStream(
405+
RNFetchBlob.writeStream(
403406
PATH_TO_FILE,
404407
// encoding, should be one of `base64`, `utf8`, `ascii`
405408
'utf8',
406409
// should data append to existing content ?
407410
true)
408-
ofstream.write('foo')
409-
ofstream.write('bar')
410-
ofstream.close()
411+
.then((ofstream) => {
412+
ofstream.write('foo')
413+
ofstream.write('bar')
414+
ofstream.close()
415+
})
411416

412417
```
413418

@@ -428,13 +433,13 @@ When using `fileCache` or `path` options along with `fetch` API, response data w
428433
})
429434

430435
// remove file by specifying a path
431-
RNFetchBlob.unlink('some-file-path').then(() => {
436+
RNFetchBlob.fs.unlink('some-file-path').then(() => {
432437
// ...
433438
})
434439

435440
```
436441

437-
You can also group the requests by using `session` API, and use `dispose` to remove them all when needed.
442+
You can also grouping requests by using `session` API, and use `dispose` to remove them all when needed.
438443

439444
```js
440445

@@ -541,6 +546,9 @@ This method returns common used folders:
541546
- CacheDir
542547
- DCIMDir (Android Only)
543548
- DownloadDir (Android Only)
549+
- MisucDir (Android Only)
550+
- PictureDir (Android Only)
551+
- MovieDir (Android Only)
544552

545553
```js
546554
RNFetchBlob.getSystemDirs().then((dirs) => {
@@ -707,6 +715,17 @@ RNFetchBlob.fs.unlink(path)
707715
.catch((err) => { ... })
708716
```
709717

718+
#### lstat(path:string):Promise
719+
720+
Get statistic data of a path, the result data will be an array contains objects like this :
721+
722+
{
723+
filename : 'foo.png',
724+
path : '/path/to/the/file/wihout/file/name/',
725+
size : 4901,
726+
type : 'file'
727+
}
728+
710729
## Types
711730

712731
---
@@ -723,7 +742,7 @@ A set of configurations that will be injected into a `fetch` method, with the fo
723742
When this property has value, `fetch` API will try to store response data in the path ignoring `fileCache` and `appendExt` property.
724743
#### addAndroidDownloads:object (Android only)
725744
This is an Android only property, it should be an object with the following properties :
726-
- title : title of the file download success notification
745+
- title : title of the file
727746
- description : File description of the file.
728747
- mime : MIME type of the file. By default is `text/plain`
729748
- mediaScannable : A `boolean` value, see [Officail Document](https://developer.android.com/reference/android/app/DownloadManager.html#addCompletedDownload(java.lang.String, java.lang.String, boolean, java.lang.String, java.lang.String, long, boolean))

0 commit comments

Comments
 (0)