FSGetCwd

Syntax

#include <cafe/fs.h>

FSStatus FSGetCwd(
                FSClient                        *client,
                FSCmdBlock                      *block,
                char                            *returnedPath,
                u32                             bytes,
                FSRetFlag                       errHandling
                );
FSStatus FSGetCwdAsync(
                FSClient                        *client,
                FSCmdBlock                      *block,
                char                            *returnedPath,
                u32                             bytes,
                FSRetFlag                       errHandling,
                const FSAsyncParams             *asyncParams
                );

Parameters

client Pointer to the client buffer.
block Command block.
returnedPath Pointer to the path buffer, where the obtained current working directory path will be stored.
bytes Length of path buffer. This must be equal to or greater than FSA_MAX_FULLPATH_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.

Async API: Immediate return values

FS_STATUS_OK Successfully issued request.
FS_STATUS_FATAL_ERROR The argument is invalid.

Description

Gets the current working directory. However, the existence of the returned directory is not guaranteed.

The possible maximum length of the full path is defined as FS_MAX_FULLPATH_SIZE (including the terminating NULL character). The argument bytes must be equal to or greater than FS_MAX_FULLPATH_SIZE. Otherwise, the FS client will change into fatal state.

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 current work directory will be stored in returnedPath on completion.

Do Not Call From

FSGetCwd

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.

FSGetCwdAsync

None.

See Also

Path space
FSChangeDir

Revision History

2014/09/16 Added "Thread that displays graphics" and "Thread that handles system messages" to "Do not call from".
2013/05/08 Automated cleanup pass.
2013/01/23 Fixed descriptions about constraints of buffer length. ,
2013/01/10 Added "Callback" to "Do not call from".
2012/07/30 Removed information about FSA.
2012/07/20 Readability and correctness cleanup.
2010/03/30 Fixed type name FSNotificationParams -> FSAsyncParams.
2010/02/27 Initial version.


CONFIDENTIAL