TianoCore EDK2 master
|
#include "Fat.h"
Go to the source code of this file.
Functions that perform file read/write.
Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file ReadWrite.c.
EFI_STATUS FatAccessOFile | ( | IN FAT_OFILE * | OFile, |
IN IO_MODE | IoMode, | ||
IN UINTN | Position, | ||
IN OUT UINTN * | DataBufferSize, | ||
IN OUT UINT8 * | UserBuffer, | ||
IN FAT_TASK * | Task | ||
) |
This function reads data from a file or writes data to a file. It uses OFile->PosRem to determine how much data can be accessed in one time.
OFile | - The open file. |
IoMode | - Indicate whether the access mode is reading or writing. |
Position | - The position where data will be accessed. |
DataBufferSize | - Size of Buffer. |
UserBuffer | - Buffer containing data. |
Task | point to task instance. |
EFI_SUCCESS | - Access the data successfully. |
Definition at line 460 of file ReadWrite.c.
EFI_STATUS FatExpandOFile | ( | IN FAT_OFILE * | OFile, |
IN UINT64 | ExpandedSize | ||
) |
Expand OFile by appending zero bytes at the end of OFile.
OFile | - The open file. |
ExpandedSize | - The number of zero bytes appended at the end of the file. |
EFI_SUCCESS | - The file is expanded successfully. |
Definition at line 537 of file ReadWrite.c.
EFI_STATUS EFIAPI FatGetPosition | ( | IN EFI_FILE_PROTOCOL * | FHand, |
OUT UINT64 * | Position | ||
) |
Get the file's position of the file.
FHand | - The handle of file. |
Position | - The file's position of the file. |
EFI_SUCCESS | - Get the info successfully. |
EFI_DEVICE_ERROR | - Can not find the OFile for the file. |
EFI_UNSUPPORTED | - The open file is not a file. |
Definition at line 27 of file ReadWrite.c.
EFI_STATUS FatIFileAccess | ( | IN EFI_FILE_PROTOCOL * | FHand, |
IN IO_MODE | IoMode, | ||
IN OUT UINTN * | BufferSize, | ||
IN OUT VOID * | Buffer, | ||
IN EFI_FILE_IO_TOKEN * | Token | ||
) |
Get the file info from the open file of the IFile into Buffer.
FHand | - The file handle to access. |
IoMode | - Indicate whether the access mode is reading or writing. |
BufferSize | - Size of Buffer. |
Buffer | - Buffer containing read data. |
Token | - A pointer to the token associated with the transaction. |
EFI_SUCCESS | - Get the file info successfully. |
EFI_DEVICE_ERROR | - Can not find the OFile for the file. |
EFI_VOLUME_CORRUPTED | - The file type of open file is error. |
EFI_WRITE_PROTECTED | - The disk is write protect. |
EFI_ACCESS_DENIED | - The file is read-only. |
Definition at line 199 of file ReadWrite.c.
Get the file info from the open file of the IFile into Buffer.
IFile | - The instance of the open file. |
BufferSize | - Size of Buffer. |
Buffer | - Buffer containing read data. |
EFI_SUCCESS | - Get the file info successfully. |
other | - An error occurred when operation the disk. |
Definition at line 122 of file ReadWrite.c.
EFI_STATUS EFIAPI FatRead | ( | IN EFI_FILE_PROTOCOL * | FHand, |
IN OUT UINTN * | BufferSize, | ||
OUT VOID * | Buffer | ||
) |
Get the file info.
FHand | - The handle of the file. |
BufferSize | - Size of Buffer. |
Buffer | - Buffer containing read data. |
EFI_SUCCESS | - Get the file info successfully. |
EFI_DEVICE_ERROR | - Can not find the OFile for the file. |
EFI_VOLUME_CORRUPTED | - The file type of open file is error. |
Definition at line 360 of file ReadWrite.c.
EFI_STATUS EFIAPI FatReadEx | ( | IN EFI_FILE_PROTOCOL * | FHand, |
IN OUT EFI_FILE_IO_TOKEN * | Token | ||
) |
Get the file info.
FHand | - The handle of the file. |
Token | - A pointer to the token associated with the transaction. |
EFI_SUCCESS | - Get the file info successfully. |
EFI_DEVICE_ERROR | - Can not find the OFile for the file. |
EFI_VOLUME_CORRUPTED | - The file type of open file is error. |
Definition at line 384 of file ReadWrite.c.
EFI_STATUS EFIAPI FatSetPosition | ( | IN EFI_FILE_PROTOCOL * | FHand, |
IN UINT64 | Position | ||
) |
Set the file's position of the file.
FHand | - The handle of file. |
Position | - The file's position of the file. |
EFI_SUCCESS | - Set the info successfully. |
EFI_DEVICE_ERROR | - Can not find the OFile for the file. |
EFI_UNSUPPORTED | - Set a directory with a not-zero position. |
Definition at line 64 of file ReadWrite.c.
EFI_STATUS FatTruncateOFile | ( | IN FAT_OFILE * | OFile, |
IN UINTN | TruncatedSize | ||
) |
Truncate the OFile to smaller file size.
OFile | - The open file. |
TruncatedSize | - The new file size. |
EFI_SUCCESS | - The file is truncated successfully. |
Definition at line 622 of file ReadWrite.c.
EFI_STATUS EFIAPI FatWrite | ( | IN EFI_FILE_PROTOCOL * | FHand, |
IN OUT UINTN * | BufferSize, | ||
IN VOID * | Buffer | ||
) |
Write the content of buffer into files.
FHand | - The handle of the file. |
BufferSize | - Size of Buffer. |
Buffer | - Buffer containing write data. |
EFI_SUCCESS | - Set the file info successfully. |
EFI_WRITE_PROTECTED | - The disk is write protect. |
EFI_ACCESS_DENIED | - The file is read-only. |
EFI_DEVICE_ERROR | - The OFile is not valid. |
EFI_UNSUPPORTED | - The open file is not a file.
|
Definition at line 411 of file ReadWrite.c.
EFI_STATUS EFIAPI FatWriteEx | ( | IN EFI_FILE_PROTOCOL * | FHand, |
IN OUT EFI_FILE_IO_TOKEN * | Token | ||
) |
Get the file info.
FHand | - The handle of the file. |
Token | - A pointer to the token associated with the transaction. |
EFI_SUCCESS | - Get the file info successfully. |
EFI_DEVICE_ERROR | - Can not find the OFile for the file. |
EFI_VOLUME_CORRUPTED | - The file type of open file is error. |
Definition at line 435 of file ReadWrite.c.
EFI_STATUS FatWriteZeroPool | ( | IN FAT_OFILE * | OFile, |
IN UINTN | WritePos | ||
) |
Write zero pool from the WritePos to the end of OFile.
OFile | - The open file to write zero pool. |
WritePos | - The number of zero bytes written. |
EFI_SUCCESS | - Write the zero pool successfully. |
EFI_OUT_OF_RESOURCES | - Not enough memory to perform the operation. |
Definition at line 567 of file ReadWrite.c.