ioLibrary_Driver
ioLibrary_Driver copied to clipboard
Adding scan_files and get_filesize functions
This PR cover the following issue: https://github.com/Wiznet/ioLibrary_Driver/issues/101
Adding scan_files and get_filesize functions, at the same time modifying get_filesize calling and ftp.fil.obj.objsize struct attribute for a correct file size retrieval using newer vesions of fatfs middleware.
Environment: STMCubeIDE: 1.16.1 FatFS version: R0.12c
MODS: As mention before, some file struct calls have been modified:
- filesize: newer versions of FatFS has moved this attribute to the object "FIL"->"_FDID" http://elm-chan.org/fsw/ff/doc/sfile.html
CWD_CMD modifications:
- get_filesize call modified, now it only needs 'arg' argument. 'tmpstr' variable and "arg[slen - 3] = 0x00" are not used. Not sure why they were implemented in the first time, but could be helpful any explanation ?
SIZE_CMD modifications:
- *tmpstr = 0 this line was deleted since it was supposed to get file size since any file location (including sub directories) deleting "/" mark does not help to retrieve information file info using FatFS API. Again, What's the main purpose for this?
Any comment or concerns are welcome.