2 Main file for mv shell level 2 function.
4 (C) Copyright 2013-2014, Hewlett-Packard Development Company, L.P.
5 Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #include "UefiShellLevel2CommandsLib.h"
19 function to determine if a move is between file systems.
21 @param FullName [in] The name of the file to move.
22 @param Cwd [in] The current working directory
23 @param DestPath [in] The target location to move to
25 @retval TRUE The move is across file system.
26 @retval FALSE The move is within a file system.
32 IN CONST CHAR16
*FullName
,
34 IN CONST CHAR16
*DestPath
41 Test
= StrStr(FullName
, L
":");
42 if (Test
== NULL
&& Cwd
!= NULL
) {
43 Test
= StrStr(Cwd
, L
":");
45 Test1
= StrStr(DestPath
, L
":");
46 if (Test1
== NULL
&& Cwd
!= NULL
) {
47 Test1
= StrStr(Cwd
, L
":");
49 if (Test1
!= NULL
&& Test
!= NULL
) {
52 Result
= StringNoCaseCompare(&FullName
, &DestPath
);
63 Function to validate that moving a specific file (FileName) to a specific
64 location (DestPath) is valid.
66 This function will verify that the destination is not a subdirectory of
67 FullName, that the Current working Directory is not being moved, and that
68 the directory is not read only.
70 if the move is invalid this function will report the error to StdOut.
72 @param FullName [in] The name of the file to move.
73 @param Cwd [in] The current working directory
74 @param DestPath [in] The target location to move to
75 @param Attribute[in] The Attribute of the file
76 @param DestAttr [in] The Attribute of the destination
77 @param FileStatus[in] The Status of the file when opened
79 @retval TRUE The move is valid
80 @retval FALSE The move is not
86 IN CONST CHAR16
*SourcePath
,
88 IN CONST CHAR16
*DestPath
,
89 IN CONST UINT64 Attribute
,
90 IN CONST UINT64 DestAttr
,
91 IN CONST EFI_STATUS FileStatus
95 CHAR16
*DestPathWalker
;
97 if (Cwd
!= NULL
&& StrCmp(SourcePath
, Cwd
) == 0) {
101 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_MV_INV_CWD
), gShellLevel2HiiHandle
);
106 // invalid to move read only or move to a read only destination
108 if (((Attribute
& EFI_FILE_READ_ONLY
) != 0)
109 || (FileStatus
== EFI_WRITE_PROTECTED
)
110 || ((DestAttr
& EFI_FILE_READ_ONLY
) != 0)
112 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_MV_INV_RO
), gShellLevel2HiiHandle
, SourcePath
);
116 DestPathCopy
= AllocateCopyPool(StrSize(DestPath
), DestPath
);
117 if (DestPathCopy
== NULL
) {
121 for (DestPathWalker
= DestPathCopy
; *DestPathWalker
== L
'\\'; DestPathWalker
++) ;
123 while(DestPathWalker
!= NULL
&& DestPathWalker
[StrLen(DestPathWalker
)-1] == L
'\\') {
124 DestPathWalker
[StrLen(DestPathWalker
)-1] = CHAR_NULL
;
127 ASSERT(DestPathWalker
!= NULL
);
128 ASSERT(SourcePath
!= NULL
);
131 // If they're the same, or if source is "above" dest on file path tree
133 if ( StrCmp(DestPathWalker
, SourcePath
) == 0
134 || StrStr(DestPathWalker
, SourcePath
) == DestPathWalker
136 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_MV_INV_SUB
), gShellLevel2HiiHandle
);
137 FreePool(DestPathCopy
);
140 FreePool(DestPathCopy
);
146 Function to take a destination path that might contain wildcards and verify
147 that there is only a single possible target (IE we cant have wildcards that
148 have 2 possible destination).
150 if the result is sucessful the caller must free *DestPathPointer.
152 @param[in] DestParameter The original path to the destination.
153 @param[in, out] DestPathPointer A pointer to the callee allocated final path.
154 @param[in] Cwd A pointer to the current working directory.
156 @retval SHELL_INVALID_PARAMETER The DestParameter could not be resolved to a location.
157 @retval SHELL_INVALID_PARAMETER The DestParameter could be resolved to more than 1 location.
158 @retval SHELL_INVALID_PARAMETER Cwd is required and is NULL.
159 @retval SHELL_SUCCESS The operation was sucessful.
164 GetDestinationLocation(
165 IN CONST CHAR16
*DestParameter
,
166 IN OUT CHAR16
**DestPathPointer
,
167 IN CONST CHAR16
*Cwd
,
168 IN CONST BOOLEAN SingleSource
,
169 IN OUT UINT64
*DestAttr
172 EFI_SHELL_FILE_INFO
*DestList
;
173 EFI_SHELL_FILE_INFO
*Node
;
181 ASSERT(DestAttr
!= NULL
);
183 if (StrStr(DestParameter
, L
"\\") == DestParameter
) {
185 return SHELL_INVALID_PARAMETER
;
187 DestPath
= AllocateZeroPool(StrSize(Cwd
));
188 if (DestPath
== NULL
) {
189 return (SHELL_OUT_OF_RESOURCES
);
191 StrCpy(DestPath
, Cwd
);
192 while (PathRemoveLastItem(DestPath
)) ;
195 // Append DestParameter beyond '\' which may be present
197 CurrentSize
= StrSize(DestPath
);
198 StrnCatGrow(&DestPath
, &CurrentSize
, &DestParameter
[1], 0);
200 *DestPathPointer
= DestPath
;
201 return (SHELL_SUCCESS
);
204 // get the destination path
206 ShellOpenFileMetaArg((CHAR16
*)DestParameter
, EFI_FILE_MODE_WRITE
|EFI_FILE_MODE_READ
|EFI_FILE_MODE_CREATE
, &DestList
);
207 if (DestList
== NULL
|| IsListEmpty(&DestList
->Link
)) {
209 // Not existing... must be renaming
211 if (StrStr(DestParameter
, L
":") == NULL
) {
213 ShellCloseFileMetaArg(&DestList
);
214 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_NO_CWD
), gShellLevel2HiiHandle
);
215 return (SHELL_INVALID_PARAMETER
);
217 NewSize
= StrSize(Cwd
);
218 NewSize
+= StrSize(DestParameter
);
219 DestPath
= AllocateZeroPool(NewSize
);
220 if (DestPath
== NULL
) {
221 ShellCloseFileMetaArg(&DestList
);
222 return (SHELL_OUT_OF_RESOURCES
);
224 StrCpy(DestPath
, Cwd
);
225 if (DestPath
[StrLen(DestPath
)-1] != L
'\\' && DestParameter
[0] != L
'\\') {
226 StrCat(DestPath
, L
"\\");
227 } else if (DestPath
[StrLen(DestPath
)-1] == L
'\\' && DestParameter
[0] == L
'\\') {
228 ((CHAR16
*)DestPath
)[StrLen(DestPath
)-1] = CHAR_NULL
;
230 StrCat(DestPath
, DestParameter
);
232 ASSERT(DestPath
== NULL
);
233 DestPath
= StrnCatGrow(&DestPath
, NULL
, DestParameter
, 0);
234 if (DestPath
== NULL
) {
235 ShellCloseFileMetaArg(&DestList
);
236 return (SHELL_OUT_OF_RESOURCES
);
240 Node
= (EFI_SHELL_FILE_INFO
*)GetFirstNode(&DestList
->Link
);
241 *DestAttr
= Node
->Info
->Attribute
;
243 // Make sure there is only 1 node in the list.
245 if (!IsNodeAtEnd(&DestList
->Link
, &Node
->Link
)) {
246 ShellCloseFileMetaArg(&DestList
);
247 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_MARG_ERROR
), gShellLevel2HiiHandle
, DestParameter
);
248 return (SHELL_INVALID_PARAMETER
);
252 // If we are a directory or a single file, then one node is fine.
254 if (ShellIsDirectory(Node
->FullName
)==EFI_SUCCESS
|| SingleSource
) {
255 DestPath
= AllocateZeroPool(StrSize(Node
->FullName
)+sizeof(CHAR16
));
256 if (DestPath
== NULL
) {
257 ShellCloseFileMetaArg(&DestList
);
258 return (SHELL_OUT_OF_RESOURCES
);
260 StrCpy(DestPath
, Node
->FullName
);
261 StrCat(DestPath
, L
"\\");
264 // cant move multiple files onto a single file.
266 ShellCloseFileMetaArg(&DestList
);
267 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_FILE_ERROR
), gShellLevel2HiiHandle
, DestParameter
);
268 return (SHELL_INVALID_PARAMETER
);
272 *DestPathPointer
= DestPath
;
273 ShellCloseFileMetaArg(&DestList
);
275 return (SHELL_SUCCESS
);
280 MoveBetweenFileSystems(
281 IN EFI_SHELL_FILE_INFO
*Node
,
282 IN CONST CHAR16
*DestPath
,
289 // First we copy the file
291 Status
= CopySingleFile(Node
->FullName
, DestPath
, Resp
, TRUE
);
296 if (!EFI_ERROR(Status
)) {
298 // The copy was successful. delete the source file.
300 CascadeDelete(Node
, TRUE
);
310 IN CONST CHAR16
**DestPath
,
311 OUT CHAR16
**FullDestPath
,
312 IN CONST CHAR16
*FileName
316 if (FullDestPath
== NULL
|| FileName
== NULL
|| DestPath
== NULL
|| *DestPath
== NULL
){
317 return (EFI_INVALID_PARAMETER
);
320 Size
= StrSize(*DestPath
) + StrSize(FileName
);
322 *FullDestPath
= AllocateZeroPool(Size
);
323 if (*FullDestPath
== NULL
){
324 return (EFI_OUT_OF_RESOURCES
);
327 StrnCpy(*FullDestPath
, *DestPath
, Size
/ sizeof(CHAR16
) - 1);
328 if ((*FullDestPath
)[StrLen(*FullDestPath
)-1] != L
'\\' && FileName
[0] != L
'\\') {
329 StrnCat(*FullDestPath
, L
"\\",Size
/ sizeof(CHAR16
) - 1 - StrLen(*FullDestPath
));
331 StrnCat(*FullDestPath
, FileName
, Size
/ sizeof(CHAR16
) - 1 - StrLen(*FullDestPath
));
333 return (EFI_SUCCESS
);
338 MoveWithinFileSystems(
339 IN EFI_SHELL_FILE_INFO
*Node
,
344 EFI_FILE_INFO
*NewFileInfo
;
345 CHAR16
*TempLocation
;
351 // Chop off map info from DestPath
353 if ((TempLocation
= StrStr(DestPath
, L
":")) != NULL
) {
354 CopyMem(DestPath
, TempLocation
+1, StrSize(TempLocation
+1));
358 // construct the new file info block
360 NewSize
= StrSize(DestPath
);
361 NewSize
+= StrSize(Node
->FileName
) + SIZE_OF_EFI_FILE_INFO
+ sizeof(CHAR16
);
362 NewFileInfo
= AllocateZeroPool(NewSize
);
363 if (NewFileInfo
== NULL
) {
364 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_NO_MEM
), gShellLevel2HiiHandle
);
365 Status
= EFI_OUT_OF_RESOURCES
;
367 CopyMem(NewFileInfo
, Node
->Info
, SIZE_OF_EFI_FILE_INFO
);
368 if (DestPath
[0] != L
'\\') {
369 StrCpy(NewFileInfo
->FileName
, L
"\\");
370 StrCat(NewFileInfo
->FileName
, DestPath
);
372 StrCpy(NewFileInfo
->FileName
, DestPath
);
374 Length
= StrLen(NewFileInfo
->FileName
);
378 if (NewFileInfo
->FileName
[Length
] == L
'\\') {
379 if (Node
->FileName
[0] == L
'\\') {
381 // Don't allow for double slashes. Eliminate one of them.
383 NewFileInfo
->FileName
[Length
] = CHAR_NULL
;
385 StrCat(NewFileInfo
->FileName
, Node
->FileName
);
387 NewFileInfo
->Size
= SIZE_OF_EFI_FILE_INFO
+ StrSize(NewFileInfo
->FileName
);
390 // Perform the move operation
392 Status
= ShellSetFileInfo(Node
->Handle
, NewFileInfo
);
395 // Free the info object we used...
397 FreePool(NewFileInfo
);
403 function to take a list of files to move and a destination location and do
404 the verification and moving of those files to that location. This function
405 will report any errors to the user and continue to move the rest of the files.
407 @param[in] FileList A LIST_ENTRY* based list of files to move
408 @param[out] Resp pointer to response from question. Pass back on looped calling
409 @param[in] DestParameter the originally specified destination location
411 @retval SHELL_SUCCESS the files were all moved.
412 @retval SHELL_INVALID_PARAMETER a parameter was invalid
413 @retval SHELL_SECURITY_VIOLATION a security violation ocurred
414 @retval SHELL_WRITE_PROTECTED the destination was write protected
415 @retval SHELL_OUT_OF_RESOURCES a memory allocation failed
420 ValidateAndMoveFiles(
421 IN EFI_SHELL_FILE_INFO
*FileList
,
423 IN CONST CHAR16
*DestParameter
430 CHAR16
*FullDestPath
;
432 SHELL_STATUS ShellStatus
;
433 EFI_SHELL_FILE_INFO
*Node
;
436 CHAR16
*CleanFilePathStr
;
438 ASSERT(FileList
!= NULL
);
439 ASSERT(DestParameter
!= NULL
);
443 Cwd
= ShellGetCurrentDir(NULL
);
446 CleanFilePathStr
= NULL
;
448 Status
= ShellLevel2StripQuotes (DestParameter
, &CleanFilePathStr
);
449 if (EFI_ERROR (Status
)) {
450 if (Status
== EFI_OUT_OF_RESOURCES
) {
451 return SHELL_OUT_OF_RESOURCES
;
453 return SHELL_INVALID_PARAMETER
;
457 ASSERT (CleanFilePathStr
!= NULL
);
460 // Get and validate the destination location
462 ShellStatus
= GetDestinationLocation(CleanFilePathStr
, &DestPath
, Cwd
, (BOOLEAN
)(FileList
->Link
.ForwardLink
== FileList
->Link
.BackLink
), &Attr
);
463 FreePool (CleanFilePathStr
);
465 if (ShellStatus
!= SHELL_SUCCESS
) {
466 return (ShellStatus
);
468 DestPath
= PathCleanUpDirectories(DestPath
);
469 if (DestPath
== NULL
) {
470 return (SHELL_OUT_OF_RESOURCES
);
473 HiiOutput
= HiiGetString (gShellLevel2HiiHandle
, STRING_TOKEN (STR_MV_OUTPUT
), NULL
);
474 HiiResultOk
= HiiGetString (gShellLevel2HiiHandle
, STRING_TOKEN (STR_GEN_RES_OK
), NULL
);
475 if (HiiOutput
== NULL
|| HiiResultOk
== NULL
) {
476 SHELL_FREE_NON_NULL(DestPath
);
477 SHELL_FREE_NON_NULL(HiiOutput
);
478 SHELL_FREE_NON_NULL(HiiResultOk
);
479 return (SHELL_OUT_OF_RESOURCES
);
483 // Go through the list of files and directories to move...
485 for (Node
= (EFI_SHELL_FILE_INFO
*)GetFirstNode(&FileList
->Link
)
486 ; !IsNull(&FileList
->Link
, &Node
->Link
)
487 ; Node
= (EFI_SHELL_FILE_INFO
*)GetNextNode(&FileList
->Link
, &Node
->Link
)
489 if (ShellGetExecutionBreakFlag()) {
494 // These should never be NULL
496 ASSERT(Node
->FileName
!= NULL
);
497 ASSERT(Node
->FullName
!= NULL
);
498 ASSERT(Node
->Info
!= NULL
);
501 // skip the directory traversing stuff...
503 if (StrCmp(Node
->FileName
, L
".") == 0 || StrCmp(Node
->FileName
, L
"..") == 0) {
507 SHELL_FREE_NON_NULL(FullDestPath
);
509 if (ShellIsDirectory(DestPath
)==EFI_SUCCESS
) {
510 CreateFullDestPath((CONST CHAR16
**)&DestPath
, &FullDestPath
, Node
->FileName
);
514 // Validate that the move is valid
516 if (!IsValidMove(Node
->FullName
, Cwd
, FullDestPath
?FullDestPath
:DestPath
, Node
->Info
->Attribute
, Attr
, Node
->Status
)) {
517 ShellStatus
= SHELL_INVALID_PARAMETER
;
521 ShellPrintEx(-1, -1, HiiOutput
, Node
->FullName
, FullDestPath
?FullDestPath
:DestPath
);
524 // See if destination exists
526 if (!EFI_ERROR(ShellFileExists(FullDestPath
?FullDestPath
:DestPath
))) {
527 if (Response
== NULL
) {
528 ShellPromptForResponseHii(ShellPromptResponseTypeYesNoAllCancel
, STRING_TOKEN (STR_GEN_DEST_EXIST_OVR
), gShellLevel2HiiHandle
, &Response
);
530 switch (*(SHELL_PROMPT_RESPONSE
*)Response
) {
531 case ShellPromptResponseNo
:
535 case ShellPromptResponseCancel
:
538 // indicate to stop everything
540 return (SHELL_ABORTED
);
541 case ShellPromptResponseAll
:
544 case ShellPromptResponseYes
:
550 return SHELL_ABORTED
;
552 Status
= ShellDeleteFileByName(FullDestPath
?FullDestPath
:DestPath
);
555 if (IsBetweenFileSystem(Node
->FullName
, Cwd
, DestPath
)) {
556 while (FullDestPath
== NULL
&& DestPath
!= NULL
&& DestPath
[0] != CHAR_NULL
&& DestPath
[StrLen(DestPath
) - 1] == L
'\\') {
557 DestPath
[StrLen(DestPath
) - 1] = CHAR_NULL
;
559 Status
= MoveBetweenFileSystems(Node
, FullDestPath
?FullDestPath
:DestPath
, &Response
);
561 Status
= MoveWithinFileSystems(Node
, DestPath
, &Response
);
567 if (EFI_ERROR(Status
)) {
568 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_ERR_UK
), gShellLevel2HiiHandle
, Status
);
569 ShellStatus
= SHELL_INVALID_PARAMETER
;
570 if (Status
== EFI_SECURITY_VIOLATION
) {
571 ShellStatus
= SHELL_SECURITY_VIOLATION
;
572 } else if (Status
== EFI_WRITE_PROTECTED
) {
573 ShellStatus
= SHELL_WRITE_PROTECTED
;
574 } else if (Status
== EFI_OUT_OF_RESOURCES
) {
575 ShellStatus
= SHELL_OUT_OF_RESOURCES
;
576 } else if (Status
== EFI_DEVICE_ERROR
) {
577 ShellStatus
= SHELL_DEVICE_ERROR
;
578 } else if (Status
== EFI_ACCESS_DENIED
) {
579 ShellStatus
= SHELL_ACCESS_DENIED
;
582 ShellPrintEx(-1, -1, L
"%s", HiiResultOk
);
587 SHELL_FREE_NON_NULL(FullDestPath
);
588 SHELL_FREE_NON_NULL(DestPath
);
589 SHELL_FREE_NON_NULL(HiiOutput
);
590 SHELL_FREE_NON_NULL(HiiResultOk
);
591 return (ShellStatus
);
595 Function for 'mv' command.
597 @param[in] ImageHandle Handle to the Image (NULL if Internal).
598 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
603 IN EFI_HANDLE ImageHandle
,
604 IN EFI_SYSTEM_TABLE
*SystemTable
609 CHAR16
*ProblemParam
;
610 SHELL_STATUS ShellStatus
;
613 EFI_SHELL_FILE_INFO
*FileList
;
617 ShellStatus
= SHELL_SUCCESS
;
623 // initialize the shell lib (we must be in non-auto-init...)
625 Status
= ShellInitialize();
626 ASSERT_EFI_ERROR(Status
);
629 // parse the command line
631 Status
= ShellCommandLineParse (EmptyParamList
, &Package
, &ProblemParam
, TRUE
);
632 if (EFI_ERROR(Status
)) {
633 if (Status
== EFI_VOLUME_CORRUPTED
&& ProblemParam
!= NULL
) {
634 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_PROBLEM
), gShellLevel2HiiHandle
, ProblemParam
);
635 FreePool(ProblemParam
);
636 ShellStatus
= SHELL_INVALID_PARAMETER
;
644 if (ShellCommandLineGetFlag(Package
, L
"-?")) {
648 switch (ParamCount
= ShellCommandLineGetCount(Package
)) {
652 // we have insufficient parameters
654 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_TOO_FEW
), gShellLevel2HiiHandle
);
655 ShellStatus
= SHELL_INVALID_PARAMETER
;
659 // must have valid CWD for single parameter...
661 if (ShellGetCurrentDir(NULL
) == NULL
){
662 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_NO_CWD
), gShellLevel2HiiHandle
);
663 ShellStatus
= SHELL_INVALID_PARAMETER
;
665 Status
= ShellOpenFileMetaArg((CHAR16
*)ShellCommandLineGetRawValue(Package
, 1), EFI_FILE_MODE_WRITE
|EFI_FILE_MODE_READ
, &FileList
);
666 if (FileList
== NULL
|| IsListEmpty(&FileList
->Link
) || EFI_ERROR(Status
)) {
667 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_FILE_NF
), gShellLevel2HiiHandle
, ShellCommandLineGetRawValue(Package
, 1));
668 ShellStatus
= SHELL_NOT_FOUND
;
671 // ValidateAndMoveFiles will report errors to the screen itself
673 ShellStatus
= ValidateAndMoveFiles(FileList
, &Response
, ShellGetCurrentDir(NULL
));
679 ///@todo make sure this works with error half way through and continues...
680 for (ParamCount
--, LoopCounter
= 1 ; LoopCounter
< ParamCount
; LoopCounter
++) {
681 if (ShellGetExecutionBreakFlag()) {
684 Status
= ShellOpenFileMetaArg((CHAR16
*)ShellCommandLineGetRawValue(Package
, LoopCounter
), EFI_FILE_MODE_WRITE
|EFI_FILE_MODE_READ
, &FileList
);
685 if (FileList
== NULL
|| IsListEmpty(&FileList
->Link
) || EFI_ERROR(Status
)) {
686 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_FILE_NF
), gShellLevel2HiiHandle
, ShellCommandLineGetRawValue(Package
, LoopCounter
));
687 ShellStatus
= SHELL_NOT_FOUND
;
690 // ValidateAndMoveFiles will report errors to the screen itself
691 // Only change ShellStatus if it's sucessful
693 if (ShellStatus
== SHELL_SUCCESS
) {
694 ShellStatus
= ValidateAndMoveFiles(FileList
, &Response
, ShellCommandLineGetRawValue(Package
, ParamCount
));
696 ValidateAndMoveFiles(FileList
, &Response
, ShellCommandLineGetRawValue(Package
, ParamCount
));
699 if (FileList
!= NULL
&& !IsListEmpty(&FileList
->Link
)) {
700 Status
= ShellCloseFileMetaArg(&FileList
);
701 if (EFI_ERROR(Status
) && ShellStatus
== SHELL_SUCCESS
) {
702 ShellStatus
= SHELL_ACCESS_DENIED
;
703 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_ERR_FILE
), gShellLevel2HiiHandle
, ShellCommandLineGetRawValue(Package
, 1), ShellStatus
|MAX_BIT
);
708 } // switch on parameter count
710 if (FileList
!= NULL
) {
711 ShellCloseFileMetaArg(&FileList
);
715 // free the command line package
717 ShellCommandLineFreeVarList (Package
);
720 SHELL_FREE_NON_NULL(Response
);
722 if (ShellGetExecutionBreakFlag()) {
723 return (SHELL_ABORTED
);
726 return (ShellStatus
);