Browse Source

Update README.md

wkh237 8 years ago
parent
commit
c369f0b537
1 changed files with 41 additions and 9 deletions
  1. 41
    9
      README.md

+ 41
- 9
README.md View File

322
 
322
 
323
 **Download Notification and Visibiliy in Download App (Android Only)**
323
 **Download Notification and Visibiliy in Download App (Android Only)**
324
 
324
 
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`. 
326
 
326
 
327
 ```js
327
 ```js
328
 RNFetchBlob.config({
328
 RNFetchBlob.config({
715
 .catch((err) => { ... })
715
 .catch((err) => { ... })
716
 ```
716
 ```
717
 
717
 
718
-#### lstat(path:string):Promise
718
+#### lstat(path:string):Promise<RNFetchBlobStat>
719
 
719
 
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).
721
 
721
 
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.
728
 
741
 
729
 ## Types
742
 ## Types
730
 
743
 
769
 // or
782
 // or
770
 resp.session('session-name')
783
 resp.session('session-name')
771
 ```
784
 ```
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
+}
772
 
804
 
773
 ---
805
 ---
774
 
806