FSError

Syntax

#include <cafe/fs.h>

#define FS_ERROR_OK                       0

#define FS_ERROR_BASE                     (-196608)
/* FS service is not initialized */
#define FS_ERROR_NOT_INIT                 (FS_ERROR_BASE-1)     // -196609
/* File system or device was too busy */
#define FS_ERROR_BUSY                     (FS_ERROR_BASE-2)     // -196610
/* Command canceled */
#define FS_ERROR_CANCELED                 (FS_ERROR_BASE-3)     // -196611
/* Indicates the end of a directory */
#define FS_ERROR_END_OF_DIRECTORY         (FS_ERROR_BASE-4)     // -196612
/* Indicates the end of a file */
#define FS_ERROR_END_OF_FILE              (FS_ERROR_BASE-5)     // -196613

/* Reached the max number of mount points */
#define FS_ERROR_MAX_MOUNTPOINTS          (FS_ERROR_BASE-16)    // -196624
/* Reached the max number of volumes */
#define FS_ERROR_MAX_VOLUMES              (FS_ERROR_BASE-17)    // -196625
/* Reached the max number of clients */
#define FS_ERROR_MAX_CLIENTS              (FS_ERROR_BASE-18)    // -196626
/* Reached the max number of file handles */
#define FS_ERROR_MAX_FILES                (FS_ERROR_BASE-19)    // -196627
/* Reached the max number of dir handles */
#define FS_ERROR_MAX_DIRS                 (FS_ERROR_BASE-20)    // -196628
/* Target is already opened or locked by another transaction */
#define FS_ERROR_ALREADY_OPEN             (FS_ERROR_BASE-21)    // -196629
/* Target path already exists */
#define FS_ERROR_ALREADY_EXISTS           (FS_ERROR_BASE-22)    // -196630
/* Target path is not found */
#define FS_ERROR_NOT_FOUND                (FS_ERROR_BASE-23)    // -196631
/* Target path is not empty */
#define FS_ERROR_NOT_EMPTY                (FS_ERROR_BASE-24)    // -196632
/* Attempted to access file with bad file mode */
#define FS_ERROR_ACCESS_ERROR             (FS_ERROR_BASE-25)    // -196633
/* Did not have permission to complete operation */
#define FS_ERROR_PERMISSION_ERROR         (FS_ERROR_BASE-26)    // -196634
/* Cannot complete transaction due to corrupted data block */
#define FS_ERROR_DATA_CORRUPTED           (FS_ERROR_BASE-27)    // -196635
/* Request would cause one of the ancestor directories to exceed its quota
 * Or no free space left in storage */
#define FS_ERROR_STORAGE_FULL             (FS_ERROR_BASE-28)    // -196636
/* Transaction journal is full, need to flush */
#define FS_ERROR_JOURNAL_FULL             (FS_ERROR_BASE-29)    // -196637

/* Operation is not available now */
#define FS_ERROR_UNAVAILABLE_CMD          (FS_ERROR_BASE-31)    // -196639
/* Operation is not supported by FS */
#define FS_ERROR_UNSUPPORTED_CMD          (FS_ERROR_BASE-32)    // -196640
/* Specified parameter is invalid */
#define FS_ERROR_INVALID_PARAM            (FS_ERROR_BASE-33)    // -196641
/* Specified path is invalid */
#define FS_ERROR_INVALID_PATH             (FS_ERROR_BASE-34)    // -196642
/* Specified buffer is invalid */
#define FS_ERROR_INVALID_BUFFER           (FS_ERROR_BASE-35)    // -196643
/* Specified alignment is invalid */
#define FS_ERROR_INVALID_ALIGNMENT        (FS_ERROR_BASE-36)    // -196644
/* Specified client handle is invalid */
#define FS_ERROR_INVALID_CLIENT_HANDLE    (FS_ERROR_BASE-37)    // -196645
/* Specified file handle is invalid */
#define FS_ERROR_INVALID_FILE_HANDLE      (FS_ERROR_BASE-38)    // -196646
/* Specified dir handle is invalid */
#define FS_ERROR_INVALID_DIR_HANDLE       (FS_ERROR_BASE-39)    // -196647
/* Specified path is a directory instead of a file. */
#define FS_ERROR_NOT_FILE                 (FS_ERROR_BASE-40)    // -196648
/* Specified path is a file instead of a directory. */
#define FS_ERROR_NOT_DIR                  (FS_ERROR_BASE-41)    // -196649
/* Request would push the file over the size limit (not the quota limit). */
#define FS_ERROR_FILE_TOO_BIG             (FS_ERROR_BASE-42)    // -196650
/* Attempted to access out of accessible area */
#define FS_ERROR_OUT_OF_RANGE             (FS_ERROR_BASE-43)    // -196651
/* Internal resources ran short */
#define FS_ERROR_OUT_OF_RESOURCES         (FS_ERROR_BASE-44)    // -196652

/* Medium is not ready to use, user has to put medium correctly */
#define FS_ERROR_MEDIA_NOT_READY          (FS_ERROR_BASE-64)    // -196672
/* Medium is in some bad condition */
#define FS_ERROR_MEDIA_ERROR              (FS_ERROR_BASE-65)    // -196673
/* Medium is write protected */
#define FS_ERROR_WRITE_PROTECTED          (FS_ERROR_BASE-66)    // -196674
/* Medium is invalid */
#define FS_ERROR_INVALID_MEDIA            (FS_ERROR_BASE-67)    // -196675

#define FS_ERROR_FATAL                    (FS_ERROR_BASE-1024)  // -197632

Elements

FS_ERROR_INVALID_PATH This error is returned if any of the following is true:
  • Pointer to path is NULL.
  • Path is NULL string ('\0').
  • Path argument is too long.
  • Absolute path is too long.
  • Using "../" to refer to the parent directory of the root directory.
  • For FSRename only:
    • Attempting to move file/directory to another volume.
    • Attempting to move file/directory to another quota.
FS_ERROR_MEDIA_ERROR This error is returned in the following cases:
  • Media connection error
  • Media failure

Description

Error codes that are returned from FSGetLastError are listed in the table above. It may take several tens of seconds to detect this type of error.

NOTE:
If you receive the FS_ERROR_INVALID_PATH error when trying to open a long path in an emulated directory on your PC, the cause might be that it reached the limit in your host PC environment before reaching the maximum length that Cafe system supports. In this case, there is a warning log message in the debug output.

See Also

Types / Structures
FSGetLastError

Revision History

2013-05-08 Automated cleanup pass.
2013-03-15 Added detailed description about FS_ERROR_MEDIA_ERROR.
2012-07-20 Readability cleanup.
2012-07-20 Added detailed description about FS_ERROR_INVALID_PATH.
2012-05-31 Initial version.


CONFIDENTIAL