Specifications

Version 2.0
37
EFI_SHELL_PROTOCOL.OpenFileByName()
Summary
Opens a file or a directory by file name.
Prototype
typdef
EFI_STATUS
(EFIAPI *EFI_SHELL_OPEN_FILE_BY_NAME) (
IN CONST CHAR16 *FileName,
OUT EFI_FILE_HANDLE *FileHandle,
IN UINT64 OpenMode
);
Parameters
FileName
Points to the null-terminated UCS-2 encoded file name.
FileHandle
On return, points to the file handle.
OpenMode
File open mode. Either EFI_FILE_MODE_READ or EFI_FILE_MODE_WRITE from
section 12.4 of the UEFI Specification.
Related Definitions
typedef VOID *EFI_FILE_HANDLE;
Description
This function opens the specified file in the specified OpenMode and returns a file
handle.
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
exists, is non-volatile and the OpenMode indicates EFI_FILE_MODE_WRITE, then
EFI_INVALID_PARAMETER is returned.
If the file name is >i, then the file handle which is returned refers to the standard
input. If the OpenMode indicates EFI_FILE_MODE_WRITE, then EFI_INVALID_PARAMETER
is returned.
If the file name is >o, then the file handle which is returned refers to the standard
output. If the OpenMode indicates EFI_FILE_MODE_READ, then EFI_INVALID_PARAMETER
is returned.
If the file name is >e, then the file handle which is returned refers to the standard
error. If the OpenMode indicates EFI_FILE_MODE_READ, then EFI_INVALID_PARAMETER
is returned.