nn::fs::TryCreateFile Function

Syntax

Result TryCreateFile(
     const wchar_t * pathName,
     s64 size
);

Arguments

Name Description
in pathName Path of the file to create.
in size Size of the file to create.

Return Values

Returns the result of the operation.

Description

Creates a file.

This function returns any error that occurs while it is creating the file.

If file creation fails, a garbage file may have been created. Call the TryDeleteFile function to delete it. If a garbage file has not been created, ResultNotFound is returned.

Which Result values need handling will differ, depending on the archive. For details, see Handling Errors During File and Directory Operations.

Note

After a file has been created with this function, if nothing has been written then in principle the process of reading will return nn::fs::ResultVerificationFailed.

Revision History

2010/12/24
Added a Note.
2010/12/22
Added a link to the error handling page.
2010/11/09
Initial version.

CONFIDENTIAL