FSGetFreeSpaceSize

Syntax

#include <cafe/fs.h>

FSStatus FSGetFreeSpaceSize(
            FSClient                *client,
            FSCmdBlock              *block,
            const char              *path,
            FSFreeSpaceSize         *returnedFreeSize,
            FSRetFlag               errHandling
            );
FSStatus FSGetFreeSpaceSizeAsync(
            FSClient                *client,
            FSCmdBlock              *block,
            const char              *path,
            FSFreeSpaceSize         *returnedFreeSize,
            FSRetFlag               errHandling,
            const FSAsyncParams     *asyncParams
            );

Parameters

client Pointer to the client buffer.
block Command block.
path Path specifying the quota. Length must be less than FS_MAX_ARGPATH_SIZE.
returnedFreeSize Pointer in which to output the free space size [bytes].
errHandling Auto error handling flag. Only indicated errors are returned.
asyncParams (Async API only) Notification parameters for an asynchronous call.

Return Values

Sync API : Return values / Async API: Callback return values

FS_STATUS_OK Successfully done.
FS_STATUS_CANCELED Command is canceled.
FS_STATUS_NOT_FOUND Target not found.(Never returned with SD card.)
FS_STATUS_PERMISSION_ERROR The caller does not have correct access permission.
FS_STATUS_MEDIA_NOT_READY (Only for manually mounted devices) Media is not present.
FS_STATUS_MEDIA_ERROR (Only for manually mounted devices) Media is in some inaccessible condition.
FS_STATUS_DATA_CORRUPTED (Only for manually mounted devices) The data is corrupted beyond repair. The volume needs format.

Async API: Immediate return values

FS_STATUS_OK Successfully issued request.
FS_STATUS_FATAL_ERROR The argument is invalid.

Description

Gets the free space, in bytes, of a quota/partition designated by path. If path does not indicate a quota, this function will get the free size of its parent quota/partition. When a new file or directory is created, the metadata also allocated from the free space size.

NOTE:
The free space may not be consistent with the usable user data size.

Both a sync and async style API are provided. To use the async API, set the user callback and parameters in asyncParams. For more information, see FSAsyncParams.

The obtained volume information is stored in returnedFreeSize when completed.

Do Not Call From

FSGetFreeSpaceSize

Thread that displays graphics Do not call this function from a thread that displays graphics. This function may block indefinitely in error cases and the application must be able to display appropriate messages.
Thread that handles system messages Do not call this function from a thread that handles system messages. This function may block indefinitely in error cases and the application must be able to handle system events such as shutdown.
Callbacks Do not call this function from any callback function.
Interrupt handler Do not call this function from any interrupt handler.
Exception handler Do not call this function from any exception handler.

FSGetFreeSpaceSizeAsync

None.

See Also

File/Directory operations
FSGetAsyncResult
FSGetStat

Revision History

2014/09/16 Added "Thread that displays graphics" and "Thread that handles system messages" to "Do not call from".
2013/05/23 Added FS_STATUS_DATA_CORRUPTED to return values.
2013/05/20 Added FS_STATUS_MEDIA_NOT_READY to return values.
2013/05/08 Automated cleanup pass.
2013/01/10 Added "Callback" to "Do not call from".
2012/07/19 Readability and correctness cleanup.
2011/08/01 Initial version.
2010/03/30 Fixed type name FSNotificationParams -> FSAsyncParams.


CONFIDENTIAL