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

Commit c369f0b

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

File tree

1 file changed

+41
-9
lines changed

1 file changed

+41
-9
lines changed

README.md

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ If mime is null or undefined, then the mime type will be inferred from the file
322322

323323
**Download Notification and Visibiliy in Download App (Android Only)**
324324

325-
If you want to download success notification or make the stored file visible like the above. You have to add some options to `config`.
325+
If you want to download notification or make the stored file visible like the above. You have to add some options to `config`.
326326

327327
```js
328328
RNFetchBlob.config({
@@ -715,16 +715,29 @@ RNFetchBlob.fs.unlink(path)
715715
.catch((err) => { ... })
716716
```
717717

718-
#### lstat(path:string):Promise
718+
#### lstat(path:string):Promise<RNFetchBlobStat>
719719

720-
Get statistic data of a path, the result data will be an array contains objects like this :
720+
Get statistic data of files in a directory, the result data will be an array of [RNFetchBlobStat](#user-content-rnfetchblobstat).
721721

722-
{
723-
filename : 'foo.png',
724-
path : '/path/to/the/file/wihout/file/name/',
725-
size : 4901,
726-
type : 'file'
727-
}
722+
```js
723+
RNFetchBlob.fs.lstat(PATH_OF_A_FOLDER)
724+
.then((stats) => {})
725+
.catch((err) => {})
726+
```
727+
728+
#### stat(path:string):Promise<RNFetchBlobStat>
729+
730+
Similar get statistic a data or a directory. the result data will be a [RNFetchBlobStat](#user-content-rnfetchblobstat).
731+
732+
```js
733+
RNFetchBlob.fs.stat(PATH_OF_THE_TARGET)
734+
.then((stats) => {})
735+
.catch((err) => {})
736+
```
737+
738+
#### scanFile(path:string):Promise (Androi Only)
739+
740+
Connect `Media Scanner` and scan the file. see [Android Media Scanner, and Downloads App Support](#user-content-android-media-scanner-and-downloads-app-support) chapter for more information.
728741

729742
## Types
730743

@@ -769,6 +782,25 @@ RNFetchBlob.session('session-name').add(resp.path())
769782
// or
770783
resp.session('session-name')
771784
```
785+
---
786+
787+
### RNFetchBlobStat
788+
789+
Statistic data of a file, see the following sample object.
790+
791+
```js
792+
{
793+
// file name
794+
filename : 'foo.png',
795+
// folder of the file or the folder itself
796+
path : '/path/to/the/file/wihout/file/name/',
797+
// size in byte
798+
size : 4901,
799+
// `file` or `directory`
800+
type : 'file',
801+
// last modified timestamp
802+
lastModified : 141323298
803+
}
772804

773805
---
774806

0 commit comments

Comments
 (0)