Specifications
10 Version 2.0
EFI_SHELL_PROTOCOL.CreateFile()
Summary
Creates a file or directory by name.
Prototype
typedef
EFI_STATUS
(EFIAPI *EFI_SHELL_CREATE_FILE)(
IN CONST CHAR16 *FileName,
IN UINT64 FileAttribs,
OUT EFI_FILE_HANDLE *FileHandle
);
Parameters
FileName
Points to the null-terminated file path.
FileAttribs
The new file’s attributes. The different attributes are described in
EFI_FILE_PROTOCOL.Open().
FileHandle
On return, points to the created file or directory’s handle.
Description
This function creates an empty new file or directory with the specified attributes and
returns the new file’s handle. If the file already exists and is read-only, then
EFI_INVALID_PARAMETER will be returned.
If the file already existed, it is truncated and its attributes updated. If the file is
created successfully, the FileHandle is the file’s handle, else, the FileHandle is NULL.
If the file name begins with >v, then the file handle which is returned refers to the
shell environment variable with the specified name. If the shell environment variable
already exists and is non-volatile then EFI_INVALID_PARAMETER is returned.
Status Codes Returned
EFI_SUCCESS The file was opened. FileHandle points to the new file’s handle.
EFI_INVALID_PARAMETER One of the parameters has an invalid value.
EFI_UNSUPPORTED Could not open the file path.
EFI_NOT_FOUND The specified file could not be found on the device, or could not
find the file system on the device.
EFI_NO_MEDIA The device has no medium.










