FSMount

Syntax

#include <cafe/fs.h>

FSStatus FSMount(
                FSClient                *client,
                FSCmdBlock              *block,
                FSMountSource           *source,
                char                    *target,
                u32                     bytes,
                FSRetFlag               errHandling
                );
FSStatus FSMountAsync(
                FSClient                *client,
                FSCmdBlock              *block,
                FSMountSource           *source,
                char                    *target,
                u32                     bytes,
                FSRetFlag               errHandling,
                const FSAsyncParams     *asyncParams
                );

Parameters

client Pointer to the client buffer.
block Command block.
source Pointer of mount source. For more information, see FSMountSource.
target Buffer for target mount point path.
bytes Length of the target. This must be greater than or equal to FS_MAX_MOUNTPATH_SIZE.
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 completed.
FS_STATUS_CANCELED The command was canceled.
FS_STATUS_NOT_FOUND Target not found.
FS_STATUS_EXISTS Specified device file is already mounted, or specified target path is in use with another volume.
FS_STATUS_UNSUPPORTED_CMD Target has been formatted to unsupported file system.
FS_STATUS_PERMISSION_ERROR The caller does not have correct access permission.
FS_STATUS_MEDIA_ERROR Media is in some inaccessible condition.

Async API: Immediate return values

FS_STATUS_OK Successfully issued request.
FS_STATUS_FATAL_ERROR The argument was invalid.

Description

Mount the volume designated by the device file path, source. The mount point path will be mapped to target.

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

NOTE:
This API is used only during development; it cannot be used in the actual product. However, only if an SD card is to be used in the product version of your application, you may be allowed to use this API. If it is required, contact your local Nintendo developer support group.
NOTE:
When running a program in CAT-R or CAT-DEV Standalone mode, if you try to access HostFile IO by using this API, you will encounter FS_STATUS_FATAL_ERROR and will not be able to return from the API.

Do Not Call From

FSMount

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.

FSMountAsync

None.

See Also

Mount
FSUnmount
FSGetMountSource
FSGetMountSourceNext

Revision History

2014/09/16 Added "Thread that displays graphics" and "Thread that handles system messages" to "Do not call from".
2013/12/26 Added FS_STATUS_UNSUPPORTED_CMD and FS_STATUS_MEDIA_ERROR to return values.
2013/05/20 Added FS_STATUS_PERMISSION_ERROR to return values.
2013/05/09 Added a note about to access HostFile IO.
2013/05/08 Automated cleanup pass.
2013/01/10 Added "Callback" to "Do not call from".
2012/12/13 Added NOTE that this API is basically for development.
2012/08/01 Fixed "Arguments" source information.
2012/07/19 Readability cleanup.
2012/03/31 Fixed type name FSNotificationParams -> FSAsyncParams. Removed FS_STATUS_MAX from return values. Changed target from input argument to output. Added size argument.
2011/12/06 Initial version.


CONFIDENTIAL