27 IN SHELL_FILE_HANDLE FileHandle
40 ; !NoFile && !EFI_ERROR (Status)
84 if ((Node->Info->Attribute & EFI_FILE_READ_ONLY) == EFI_FILE_READ_ONLY) {
89 if ((Node->Info->Attribute & EFI_FILE_DIRECTORY) == EFI_FILE_DIRECTORY) {
94 ASSERT (Resp !=
NULL);
95 if (EFI_ERROR (Status) || (*Resp != ShellPromptResponseYes)) {
96 SHELL_FREE_NON_NULL (Resp);
100 SHELL_FREE_NON_NULL (Resp);
106 Status = gEfiShellProtocol->FindFilesInDir (Node->Handle, &List);
107 if (EFI_ERROR (Status)) {
109 gEfiShellProtocol->FreeFileList (&List);
127 Node2->
Status = gEfiShellProtocol->OpenFileByName (Node2->
FullName, &Node2->
Handle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE);
134 if (TempName ==
NULL) {
137 StrCpyS (TempName, NewSize/
sizeof (CHAR16), Node->FullName);
138 TempName[
StrStr (TempName, L
":")+1-TempName] = CHAR_NULL;
146 Node2->
Status = gEfiShellProtocol->OpenFileByName (Node2->
FullName, &Node2->
Handle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE);
150 if (!EFI_ERROR (Node2->
Status)) {
158 gEfiShellProtocol->FreeFileList (&List);
161 return (ShellStatus);
166 gEfiShellProtocol->FreeFileList (&List);
171 if (!((
StrCmp (Node->FileName, L
".") == 0) || (
StrCmp (Node->FileName, L
"..") == 0))) {
179 Status = gEfiShellProtocol->DeleteFile (Node->Handle);
212 CONST CHAR16 *TempLocation;
214 CHAR16 *SearchString;
218 if ((Node ==
NULL) || (Node->FullName ==
NULL)) {
222 TempLocation =
StrStr (Node->FullName, L
":");
223 if ((TempLocation ==
NULL) || (
StrLen (TempLocation) <= 2)) {
231 if (TempLocation ==
NULL) {
241 Pattern =
StrnCatGrow (&Pattern, &Size, TempLocation, 0);
244 SearchString =
StrnCatGrow (&SearchString, &Size, Node->FullName, 0);
245 if (SearchString ==
NULL) {
251 SearchString =
StrnCatGrow (&SearchString, &Size, L
"\\", 0);
252 SearchString =
StrnCatGrow (&SearchString, &Size, L
"*", 0);
255 if ((Pattern ==
NULL) || (SearchString ==
NULL)) {
259 if (gUnicodeCollation->MetaiMatch (gUnicodeCollation, Pattern, SearchString)) {
265 SHELL_FREE_NON_NULL (Pattern);
266 SHELL_FREE_NON_NULL (SearchString);
286 CHAR16 *ProblemParam;
308 if (EFI_ERROR (Status)) {
309 if ((Status == EFI_VOLUME_CORRUPTED) && (ProblemParam !=
NULL)) {
340 Status =
ShellOpenFileMetaArg ((CHAR16 *)Param, EFI_FILE_MODE_WRITE|EFI_FILE_MODE_READ, &FileList);
367 if (EFI_ERROR (Node->
Status)) {
386 if (FileList !=
NULL) {
399 return (ShellStatus);
BOOLEAN EFIAPI IsNull(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
UINTN EFIAPI StrSize(IN CONST CHAR16 *String)
BOOLEAN EFIAPI IsListEmpty(IN CONST LIST_ENTRY *ListHead)
RETURN_STATUS EFIAPI StrCpyS(OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source)
LIST_ENTRY *EFIAPI GetNextNode(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
INTN EFIAPI StrCmp(IN CONST CHAR16 *FirstString, IN CONST CHAR16 *SecondString)
LIST_ENTRY *EFIAPI GetFirstNode(IN CONST LIST_ENTRY *List)
RETURN_STATUS EFIAPI StrCatS(IN OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source)
UINTN EFIAPI StrLen(IN CONST CHAR16 *String)
CHAR16 *EFIAPI StrStr(IN CONST CHAR16 *String, IN CONST CHAR16 *SearchString)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
EFI_STATUS EFIAPI FileHandleFindNextFile(IN EFI_FILE_HANDLE DirHandle, OUT EFI_FILE_INFO *Buffer, OUT BOOLEAN *NoFile)
EFI_STATUS EFIAPI FileHandleFindFirstFile(IN EFI_FILE_HANDLE DirHandle, OUT EFI_FILE_INFO **Buffer)
#define ASSERT_EFI_ERROR(StatusParameter)
@ SHELL_INVALID_PARAMETER
EFI_FILE_INFO * FileInfo(IN EFI_FILE_HANDLE FHand)
SHELL_STATUS CascadeDelete(IN EFI_SHELL_FILE_INFO *Node, IN CONST BOOLEAN Quiet)
SHELL_STATUS EFIAPI ShellCommandRunRm(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
BOOLEAN IsDirectoryEmpty(IN SHELL_FILE_HANDLE FileHandle)
BOOLEAN IsValidDeleteTarget(IN CONST EFI_SHELL_FILE_INFO *List, IN CONST EFI_SHELL_FILE_INFO *Node, IN CONST LIST_ENTRY *Package)
CONST CHAR16 *EFIAPI ShellGetCurrentDir(IN CHAR16 *CONST DeviceName OPTIONAL)
BOOLEAN EFIAPI ShellGetExecutionBreakFlag(VOID)
EFI_STATUS EFIAPI ShellCloseFileMetaArg(IN OUT EFI_SHELL_FILE_INFO **ListHead)
#define ShellCommandLineParse(CheckList, CheckPackage, ProblemParam, AutoPageBreak)
Make it easy to upgrade from older versions of the shell library.
EFI_STATUS EFIAPI ShellPrintHiiEx(IN INT32 Col OPTIONAL, IN INT32 Row OPTIONAL, IN CONST CHAR8 *Language OPTIONAL, IN CONST EFI_STRING_ID HiiFormatStringId, IN CONST EFI_HII_HANDLE HiiFormatHandle,...)
BOOLEAN EFIAPI ShellCommandLineGetFlag(IN CONST LIST_ENTRY *CONST CheckPackage, IN CONST CHAR16 *CONST KeyString)
@ TypeFlag
A flag that is present or not present only (IE "-a").
CHAR16 *EFIAPI StrnCatGrow(IN OUT CHAR16 **Destination, IN OUT UINTN *CurrentSize, IN CONST CHAR16 *Source, IN UINTN Count)
EFI_STATUS EFIAPI ShellPromptForResponse(IN SHELL_PROMPT_REQUEST_TYPE Type, IN CHAR16 *Prompt OPTIONAL, IN OUT VOID **Response OPTIONAL)
EFI_STATUS EFIAPI ShellOpenFileMetaArg(IN CHAR16 *Arg, IN UINT64 OpenMode, IN OUT EFI_SHELL_FILE_INFO **ListHead)
VOID EFIAPI ShellCommandLineFreeVarList(IN LIST_ENTRY *CheckPackage)
EFI_STATUS EFIAPI ShellInitialize(VOID)
EFI_STATUS EFIAPI ShellIsDirectory(IN CONST CHAR16 *DirName)
CONST CHAR16 *EFIAPI ShellCommandLineGetRawValue(IN CONST LIST_ENTRY *CONST CheckPackage, IN UINTN Position)
LIST_ENTRY Link
Linked list members.
SHELL_FILE_HANDLE Handle
Handle for interacting with the opened file or NULL if closed.
EFI_STATUS Status
Status of opening the file. Valid only if Handle != NULL.
CONST CHAR16 * FullName
Fully qualified filename.
CONST CHAR16 * FileName
name of this file.