Information Technology Reference
In-Depth Information
10
File Operations
After the storage media has been formatted with a file system, firmware can
create, read, modify, and delete files. This chapter presents firmware that
performs these operations.
The code in this chapter uses the FILE and DISK structures introduced in
Chapter 8 and the DIRENTRY structure introduced in Chapter 9.
The functions that access files use return values of type CETYPE:
typedef byte CETYPE;
#define CE_GOOD
0
// No error
#define CE_NOT_INIT
6
// Card isn't initialized due to an error
#define CE_BAD_SECTOR_READ
7
// Error in reading a sector
#define CE_WRITE_ERROR
8
// Couldn't write to the sector
#define CE_FILE_NOT_FOUND
10
// Couldn't find the file
#define CE_DIR_FULL
17
// All of the entries are in use
#define CE_DISK_FULL
18
// All of the clusters are full
#define CE_WRITE_PROTECTED
22
// The card is write protected
#define CE_BADCACHEREAD
28
// Sector read failed
#define CE_EOF
61
// End of file reached
Search WWH ::




Custom Search