Home | History | Annotate | Download | only in NvVarsFileLib

Lines Matching defs:File

1 /** @file

2 File System Access for NvVarsFileLib
23 Open the NvVars file for reading or writing
26 @param[in] ReadingFile - TRUE: open the file for reading. FALSE: writing
28 with the opened NvVars file.
30 @return EFI_SUCCESS if the file was opened
65 // Attempt to open the NvVars file in the root directory
89 Open the NvVars file for reading or writing
91 @param[in] File - The file to inspect
92 @param[out] Exists - Returns whether the file exists
93 @param[out] Size - Returns the size of the file
94 (0 if the file does not exist)
99 IN EFI_FILE_HANDLE File,
109 FileInfo = FileHandleGetInfo (File);
127 Open the NvVars file for reading or writing
129 @param[in] File - The file to inspect
130 @param[out] Exists - Returns whether the file exists
131 @param[out] Size - Returns the size of the file
132 (0 if the file does not exist)
137 IN EFI_FILE_HANDLE File
146 FileInfo = FileHandleGetInfo (File);
160 // If the file size is already 0, then it is empty, so
169 // Set the file size to 0.
172 Status = FileHandleSetInfo (File, FileInfo);
181 Reads a file to a newly allocated buffer
183 @param[in] File - The file to read
184 @param[in] ReadSize - The size of data to read from the file
186 @return Pointer to buffer allocated to hold the file
219 Reads the contents of the NvVars file on the file system
223 @return EFI_STATUS based on the success or failure of the file read
232 EFI_FILE_HANDLE File;
238 Status = GetNvVarsFile (FsHandle, TRUE, &File);
240 DEBUG ((EFI_D_INFO, "FsAccess.c: Could not open NV Variables file on this file system\n"));
244 NvVarsFileReadCheckup (File, &FileExists, &FileSize);
246 FileHandleClose (File);
250 FileContents = FileHandleReadToNewBuffer (File, FileSize);
252 FileHandleClose (File);
258 "FsAccess.c: Read %Lu bytes from NV Variables file\n",
272 FileHandleClose (File);
280 have been loaded from the file system.
312 Loads the non-volatile variables from the NvVars file on the
313 given file system.
337 // want to re-load the file as it would overwrite newer changes
355 // Attempt to restore the variables from the NvVars file.
372 "FsAccess.c: Read NV Variables file (size=%Lu)\n",
415 Saves the non-volatile variables into the NvVars file on the
416 given file system.
429 EFI_FILE_HANDLE File;
477 // Open the NvVars file for writing.
479 Status = GetNvVarsFile (FsHandle, FALSE, &File);
481 DEBUG ((EFI_D_INFO, "FsAccess.c: Unable to open file to saved NV Variables\n"));
486 // Empty the starting file contents.
488 Status = FileHandleEmpty (File);
490 FileHandleClose (File);
495 Status = FileHandleWrite (File, &WriteSize, VariableData);
500 FileHandleClose (File);
510 DEBUG ((EFI_D_INFO, "Saved NV Variables to NvVars file\n"));