Closed efstathiosntonas closed 2 years ago
Named api statDir()
to avoid confusion with system lstat (check status of symlink).
Thanks @alpha0010! Will try it tomorrow, I want to see how this will perform in big directories.
@alpha0010 i think we got an extra /
(on iOS, haven't tested Adnroid yet):
[{
"filename": "dfad955ed4b975ead480412fdd6dd725429b88b2.jpg",
"lastModified": 1648792879016.788,
"path": "/Users/stathis/Library/Developer/CoreSimulator/Devices/90F248ED-570F-463D-8D18-FF9151CF1F77/data/Containers/Data/Application/D7B5FD9D-E472-4CB3-A554-33212E60CC04/Library/Caches/images_cache// <----- HERE dfad955ed4b975ead480412fdd6dd725429b88b2.jpg",
"size": 5710544,
"type": "file"
},
{
"filename": "dfad955ed4b975ead480412fdd6dd725429b88b2 copy.jpg",
"lastModified": 1648792879016.788,
"path": "/Users/stathis/Library/Developer/CoreSimulator/Devices/90F248ED-570F-463D-8D18-FF9151CF1F77/data/Containers/Data/Application/D7B5FD9D-E472-4CB3-A554-33212E60CC04/Library/Caches/images_cache// <--- HERE dfad955ed4b975ead480412fdd6dd725429b88b2 copy.jpg",
"size": 5710544,
"type": "file"
}]
BaseDir has this format: baseDir: ${Dirs.CacheDir}/images_cache/
otherwise the images are thrown in Caches/image.png
instead of Caches/images_cache/image.png
if I remove the trailing /
.
edit: On Android the file path is fine:
[{"filename": "fa9b55edf623d5de305fb269167a1eda44cb1daf.jpg", "lastModified": 1648803976000, "path": "/data/user/0/com.reactnativeimagecacheexample/cache/images_cache/fa9b55edf623d5de305fb269167a1eda44cb1daf.jpg", "size": 4396619, "type": "file"}]
^^ this has been fixed on 2.4.1, just for the record. Thanks @alpha0010 !
Hi @alpha0010,
I'm the maintainer of georstat/react-native-image-cache, we want to implement
lstat
for directories so I can get the file info.Right now I just
ls
and then iterate over files to get thestat
from each file and this has performance impact since the cached images could be thousands.rn-fetch-blob has
lstat
, we want exactly this.Can you implement the
lstat
feature? Thanks!