I am doing SDCARD scanner which scans each folder and image file.
I am using C code & using opendir, readdir, fopen APIs to enumerate directory and file open. i have dirent, DIR variables.
Problem is fopen() is taking too much time (300 sec for 10000 files) while director traversing is taking ~25 seconds.
Is there any API which allows me to speed up file open operation, using handle, dir_ino or similar so that i can open file using directory handle or similar.
So far i have looked n tried to use dirent->dir_ino, DIR* but no luck.
I m seeking for low-level api which takes lesser time than fopen.
edit will fts and ftw apis be usefull? they seems to be related to traversing directory only...any other hack or method?
The only "low level" function is open
int fd = open(dirent->d_name, O_RDONLY);
Though, fopen
shouldn't be a lot slower.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With