12.07.2015 Views

Waspmote SD CARD - Libelium

Waspmote SD CARD - Libelium

Waspmote SD CARD - Libelium

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Directory OperationsAn example of the output by <strong>SD</strong>.ls(LS_R|LS_DATE|LS_SIZE); would be:FILE8 1980-01-01 00:00:00 204FILE2 1980-01-01 00:00:00 2754FOLDER/ 2000-01-01 01:00:00SUBFOLD/ 2000-01-01 01:00:00FILE.TXT 2012-06-11 11:58:10 811• Listing directories example:http://www.libelium.com/development/waspmote/examples/sd-06-list-files4.4. Finding a DirectoryIt finds a sub-directory in the current directory. If it exists and it is a directory ‘1’ will be returned, ‘0’ will be returned if it exists butit is not a directory and ‘-1’ will be returned if it does not exist.Example of use{uint8_t isdir;const char* name = ”FOLDER”;// tests existence of “FOLDER” in the current directoryisdir = <strong>SD</strong>.isDir(name);}// tests existence of “FOLDER” in the current directoryisdir = <strong>SD</strong>.isDir(“FOLDER”);4.5. Number of filesIt gets the amount of files and subdirectories in the current directory. It returns the number of files or directories found, or zero ifthere are no files or directories. It does not count ‘.’ and ‘..’ directories, so if there are no directories or files in the current directory,zero will be returned.If an error occurs, a negative number is returned.Example of use{}int8_t numfiles;// returns the number of files in the current directorynumfiles = <strong>SD</strong>.numFiles();-10- v4.6

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!