TianoCore EDK2 master
|
#include "UefiShellLevel2CommandsLib.h"
Go to the source code of this file.
Functions | |
BOOLEAN | IsBetweenFileSystem (IN CONST CHAR16 *FullName, IN CONST CHAR16 *Cwd, IN CONST CHAR16 *DestPath) |
BOOLEAN | IsSoucePathValid (IN CONST CHAR16 *SrcPath, IN CONST CHAR16 *CwdPath) |
BOOLEAN | IsValidMove (IN CONST CHAR16 *SourcePath, IN CONST CHAR16 *Cwd, IN CONST CHAR16 *DestPath, IN CONST UINT64 Attribute, IN CONST UINT64 DestAttr, IN CONST EFI_STATUS FileStatus) |
SHELL_STATUS | GetDestinationLocation (IN CONST CHAR16 *DestParameter, IN OUT CHAR16 **DestPathPointer, IN CONST CHAR16 *Cwd, IN CONST BOOLEAN SingleSource, IN OUT UINT64 *DestAttr) |
EFI_STATUS | MoveBetweenFileSystems (IN EFI_SHELL_FILE_INFO *Node, IN CONST CHAR16 *DestPath, OUT VOID **Resp) |
EFI_STATUS | CreateFullDestPath (IN CONST CHAR16 **DestPath, OUT CHAR16 **FullDestPath, IN CONST CHAR16 *FileName) |
EFI_STATUS | MoveWithinFileSystems (IN EFI_SHELL_FILE_INFO *Node, IN CHAR16 *DestPath, OUT VOID **Resp) |
SHELL_STATUS | ValidateAndMoveFiles (IN EFI_SHELL_FILE_INFO *FileList, OUT VOID **Resp, IN CONST CHAR16 *DestParameter) |
SHELL_STATUS EFIAPI | ShellCommandRunMv (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
Main file for mv shell level 2 function.
(C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Mv.c.
EFI_STATUS CreateFullDestPath | ( | IN CONST CHAR16 ** | DestPath, |
OUT CHAR16 ** | FullDestPath, | ||
IN CONST CHAR16 * | FileName | ||
) |
Function to take the destination path and target file name to generate the full destination path.
[in] | DestPath | A pointer to the destination file path string. |
[out] | FullDestPath | A pointer to the full destination path string. |
[in] | FileName | Name string of the targe file. |
SHELL_SUCCESS | the files were all moved. |
SHELL_INVALID_PARAMETER | a parameter was invalid |
SHELL_OUT_OF_RESOURCES | a memory allocation failed |
SHELL_STATUS GetDestinationLocation | ( | IN CONST CHAR16 * | DestParameter, |
IN OUT CHAR16 ** | DestPathPointer, | ||
IN CONST CHAR16 * | Cwd, | ||
IN CONST BOOLEAN | SingleSource, | ||
IN OUT UINT64 * | DestAttr | ||
) |
Function to take a destination path that might contain wildcards and verify that there is only a single possible target (IE we cant have wildcards that have 2 possible destination).
if the result is successful the caller must free *DestPathPointer.
[in] | DestParameter | The original path to the destination. |
[in,out] | DestPathPointer | A pointer to the callee allocated final path. |
[in] | Cwd | A pointer to the current working directory. |
[in] | SingleSource | TRUE to have only one source file. |
[in,out] | DestAttr | A pointer to the destination information attribute. |
SHELL_INVALID_PARAMETER | The DestParameter could not be resolved to a location. |
SHELL_INVALID_PARAMETER | The DestParameter could be resolved to more than 1 location. |
SHELL_INVALID_PARAMETER | Cwd is required and is NULL. |
SHELL_SUCCESS | The operation was successful. |
BOOLEAN IsBetweenFileSystem | ( | IN CONST CHAR16 * | FullName, |
IN CONST CHAR16 * | Cwd, | ||
IN CONST CHAR16 * | DestPath | ||
) |
function to determine if a move is between file systems.
FullName | [in] The name of the file to move. |
Cwd | [in] The current working directory |
DestPath | [in] The target location to move to |
TRUE | The move is across file system. |
FALSE | The move is within a file system. |
function to determine if SrcPath is valid to mv.
if SrcPath equal CWD then it's invalid. if SrcPath is the parent path of CWD then it's invalid. is SrcPath is NULL return FALSE.
if CwdPath is NULL then ASSERT()
SrcPath | [in] The source path. |
CwdPath | [in] The current working directory. |
TRUE | The source path is valid. |
FALSE | The source path is invalid. |
BOOLEAN IsValidMove | ( | IN CONST CHAR16 * | SourcePath, |
IN CONST CHAR16 * | Cwd, | ||
IN CONST CHAR16 * | DestPath, | ||
IN CONST UINT64 | Attribute, | ||
IN CONST UINT64 | DestAttr, | ||
IN CONST EFI_STATUS | FileStatus | ||
) |
Function to validate that moving a specific file (FileName) to a specific location (DestPath) is valid.
This function will verify that the destination is not a subdirectory of FullName, that the Current working Directory is not being moved, and that the directory is not read only.
if the move is invalid this function will report the error to StdOut.
SourcePath | [in] The name of the file to move. |
Cwd | [in] The current working directory |
DestPath | [in] The target location to move to |
Attribute | [in] The Attribute of the file |
DestAttr | [in] The Attribute of the destination |
FileStatus | [in] The Status of the file when opened |
TRUE | The move is valid |
FALSE | The move is not |
EFI_STATUS MoveBetweenFileSystems | ( | IN EFI_SHELL_FILE_INFO * | Node, |
IN CONST CHAR16 * | DestPath, | ||
OUT VOID ** | Resp | ||
) |
Function to do a move across file systems.
[in] | Node | A pointer to the file to be removed. |
[in] | DestPath | A pointer to the destination file path. |
[out] | Resp | A pointer to response from question. Pass back on looped calling |
SHELL_SUCCESS | The source file was moved to the destination. |
EFI_STATUS MoveWithinFileSystems | ( | IN EFI_SHELL_FILE_INFO * | Node, |
IN CHAR16 * | DestPath, | ||
OUT VOID ** | Resp | ||
) |
Function to do a move within a file system.
[in] | Node | A pointer to the file to be removed. |
[in] | DestPath | A pointer to the destination file path. |
[out] | Resp | A pointer to response from question. Pass back on looped calling. |
SHELL_SUCCESS | The source file was moved to the destination. |
SHELL_OUT_OF_RESOURCES | A memory allocation failed. |
SHELL_STATUS EFIAPI ShellCommandRunMv | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
SHELL_STATUS ValidateAndMoveFiles | ( | IN EFI_SHELL_FILE_INFO * | FileList, |
OUT VOID ** | Resp, | ||
IN CONST CHAR16 * | DestParameter | ||
) |
function to take a list of files to move and a destination location and do the verification and moving of those files to that location. This function will report any errors to the user and continue to move the rest of the files.
[in] | FileList | A LIST_ENTRY* based list of files to move |
[out] | Resp | pointer to response from question. Pass back on looped calling |
[in] | DestParameter | the originally specified destination location |
SHELL_SUCCESS | the files were all moved. |
SHELL_INVALID_PARAMETER | a parameter was invalid |
SHELL_SECURITY_VIOLATION | a security violation ocurred |
SHELL_WRITE_PROTECTED | the destination was write protected |
SHELL_OUT_OF_RESOURCES | a memory allocation failed |