File Management functions

File Management Functions

The following functions are used to manage files.

FunctionDescription
AreFileApisANSIDetermines whether the file I/O functions are using the ANSI or OEM character set code page.
CheckNameLegalDOS8Dot3Determines whether a specified name can be used to create a file on a FAT file system.
CloseHandleCloses an open object handle.
CopyFileCopies an existing file to a new file.
CopyFileExCopies an existing file to a new file, and notifies an application of the progress through a callback function.
CopyFileTransactedCopies an existing file to a new file as a transacted operation, notifying the application of its progress through a callback function.
CreateFileCreates or opens a file, directory, physical disk, volume, console buffer, tape drive, communications resource, mailslot, or named pipe.
CreateFileTransactedCreates or opens a file, file stream, directory, physical disk, volume, console buffer, tape drive, communications resource, mailslot, or named pipe as a transacted operation.
CreateHardLinkEstablishes a hard link between an existing file and a new file.
CreateHardLinkTransactedEstablishes a hard link between an existing file and a new file as a transacted operation.
CreateSymbolicLinkCreates a symbolic link.
CreateSymbolicLinkTransactedCreates a symbolic link as a transacted operation.
DeleteFileDeletes an existing file.
DeleteFileTransactedDeletes an existing file as a transacted operation.
FindCloseCloses a file search handle that the FindFirstFile, FindFirstFileEx, or FindFirstStreamW function opens.
FindFirstFileSearches a directory for a file or subdirectory name that matches a specified name.
FindFirstFileExSearches a directory for a file or subdirectory name and attributes that match those that are specified.
FindFirstFileNameTransactedWCreates an enumeration of all the hard links to the specified file as a transacted operation. The function returns a handle to the enumeration that can be used on subsequent calls to the FindNextFileNameW function.
FindFirstFileNameWCreates an enumeration of all the hard links to the specified file. The FindFirstFileNameW function returns a handle to the enumeration that can be used on subsequent calls to the FindNextFileNameW function.
FindFirstFileTransactedSearches a directory for a file or subdirectory with a name that matches a specific name as a transacted operation.
FindFirstStreamTransactedWEnumerates the first stream in the specified file or directory as a transacted operation.
FindFirstStreamWEnumerates the first stream in a specified file or directory.
FindNextFileContinues a file search.
FindNextStreamWContinues a stream search.
GetBinaryTypeDetermines whether a file is executable. If the file is executable, this function determines the type of executable file.
GetCompressedFileSizeRetrieves the actual number of disk storage bytes that are used to store a specified file.
GetCompressedFileSizeTransactedRetrieves the actual number of bytes of disk storage used to store a specified file as a transacted operation.
GetFileAttributesRetrieves a set of FAT file system attributes for a specified file or directory.
GetFileAttributesExRetrieves attributes for a specified file or directory.
GetFileAttributesTransactedRetrieves a set of FAT file system attributes for a specified file or directory as a transacted operation.
GetFileBandwidthReservationRetrieves the bandwidth reservation properties of the volume on which the specified file resides.
GetFileInformationByHandleRetrieves file information for a specified file.
GetFileInformationByHandleExRetrieves file information for the specified file.
GetFileSizeRetrieves the size of a specified file. The file size that can be reported by this function is limited to a DWORD value.
GetFileSizeExRetrieves the size of a specified file.
GetFileTypeRetrieves the file type of a specified file.
GetFinalPathNameByHandleRetrieves the final filesystem path for the specified file.
GetFullPathNameRetrieves the full path and file name of a specified file.
GetFullPathNameTransactedRetrieves the full path and file name of a specified file as a transacted operation.
GetLongPathNameConverts a specified path to its long form.
GetLongPathNameTransactedConverts the specified path to its long form as a transacted operation.
GetShortPathNameRetrieves the short path form of a specified path.
GetTempFileNameCreates a name for a temporary file.
GetTempPathRetrieves the path of the directory that is designated for temporary files.
MoveFileMoves an existing file or directory and its children.
MoveFileExMoves an existing file or directory.
MoveFileTransactedMoves an existing file or a directory, including its children, as a transacted operation.
MoveFileWithProgressMoves a file or directory. You can provide a callback function that receives progress notifications.
OpenFileCreates, opens, reopens, or deletes a file.
OpenFileByIdOpens the file that matches the specified identifier.
ReOpenFileReopens a specified file system object with different access rights, a different sharing mode, and different flags than it was previously opened with.
ReplaceFileReplaces one file with a different file, and optionally creates a backup copy of the original file.
RtlIsNameLegalDOS8Dot3Determines whether or not a specified name can be used to create a file on the FAT file system.
SearchPathSearches for a specified file in a specified path.
SetFileApisToANSIIndicates that the file I/O functions must use the ANSI character set code page.
SetFileApisToOEMCauses the file I/O functions to use the OEM character set code page.
SetFileAttributesSets the attributes of a file.
SetFileAttributesTransactedSets the attributes for a file or directory as a transacted operation.
SetFileBandwidthReservationRequests that bandwidth for the specified file stream be reserved.
SetFileInformationByHandleSets the information for the specified file.
SetFileShortNameSets the short name for a specified file.
SetFileValidDataSets the valid data length of a specified file.

The following functions are used with file I/O.

FunctionDescription
CancelIoCancels all pending I/O operations that are issued by the calling thread for a specified file handle.
CancelIoExMarks all pending I/O operations for the specified file handle in the current process as canceled, regardless of which thread created the I/O operation.
CancelSynchronousIoMarks pending synchronous I/O operations that are issued by the specified thread as canceled.
CreateIoCompletionPortAssociates an I/O completion port with one or more file handles, or creates an I/O completion port that is not associated with a file handle.
FlushFileBuffersFlushes the buffers for a specified file, and causes all buffered data to be written to the file.
GetQueuedCompletionStatusAttempts to dequeue an I/O completion packet from a specified I/O completion port.
GetQueuedCompletionStatusExRetrieves multiple completion port entries simultaneously.
LockFileLocks a specified file for exclusive access by the calling process.
LockFileExLocks a specified file for exclusive access by the calling process. This function can operate synchronously or asynchronously.
PostQueuedCompletionStatusPosts an I/O completion packet to an I/O completion port.
ReadFileReads data from a file, starting at the position that is indicated by a file pointer. This function can operate synchronously and asynchronously.
ReadFileExReads data from a file asynchronously.
ReadFileScatterReads data from a file and stores it in an array of buffers.
SetEndOfFileMoves the end-of-file position for a specified file to the current position of a file pointer.
SetFileCompletionNotificationModesSets the notification modes for a file handle.
SetFileIoOverlappedRangeAssociates a virtual address range with a file handle.
SetFilePointerMoves the file pointer of an open file.
SetFilePointerExMoves the file pointer of a specified file.
UnlockFileUnlocks a region in an open file.
UnlockFileExUnlocks a region in an open file. This function can operate synchronously or asynchronously.
WriteFileWrites data to a file at a position that a file pointer specifies. This function can operate synchronously and asynchronously.
WriteFileExWrites data to a file. This function reports the completion status asynchronously by calling a specified completion routine when writing is completed or canceled and when the calling thread is in an alertable wait state.
WriteFileGatherRetrieves data from an array of buffers, and then writes the data to a file.

The following functions are used with the encrypted file system.

FunctionDescription
AddUsersToEncryptedFileAdds user keys to a specified encrypted file.
CloseEncryptedFileRawCloses an encrypted file after a backup or restore operation, and frees the associated system resources.
DecryptFileDecrypts an encrypted file or directory.
DuplicateEncryptionInfoFileCopies the EFS metadata from one file or directory to another.
EncryptFileEncrypts a file or directory.
EncryptionDisableDisables or enables encryption of a specified directory and the files in the directory.
FileEncryptionStatusRetrieves the encryption status of a specified file.
FreeEncryptionCertificateHashListFrees a certificate hash list.
OpenEncryptedFileRawOpens an encrypted file to backup (export) or restore (import) the file.
QueryRecoveryAgentsOnEncryptedFileRetrieves a list of recovery agents for a specified file.
QueryUsersOnEncryptedFileRetrieves a list of users for a specified file.
ReadEncryptedFileRawBacks up (exports) encrypted files.
RemoveUsersFromEncryptedFileRemoves specified certificate hashes from a specified file.
SetUserFileEncryptionKeySets a current user key to a specified certificate.
WriteEncryptedFileRawRestores (imports) encrypted files.

The following functions are used with the file system redirector.

FunctionDescription
Wow64DisableWow64FsRedirectionDisables file system redirection for the calling thread.
Wow64EnableWow64FsRedirectionEnables or disables file system redirection for the calling thread.
Wow64RevertWow64FsRedirectionRestores file system redirection for the calling thread.

The following functions are used to decompress files that are compressed by the Lempel-Ziv algorithm.

FunctionDescription
GetExpandedNameRetrieves the original name of a compressed file, only if the file is compressed by the Lempel-Ziv algorithm.
LZCloseCloses a file that was opened by using the LZOpenFile function.
LZCopyCopies a source file to a destination file.
LZInitAllocates memory for the internal data structures that are required to decompress files, and then creates and initializes the files.
LZOpenFileCreates, opens, reopens, or deletes a specified file.
LZReadReads a specified number of bytes from a file and copies them into a buffer.
LZSeekMoves a file pointer a specified number of bytes from a starting position.

The following callback functions are used in file I/O.

FunctionDescription
CopyProgressRoutineCallback function used with the CopyFileEx and MoveFileWithProgress functions, called when a portion of a copy or move operation is completed.
ExportCallbackCallback function used with ReadEncryptedFileRaw, called one or more times, each time with a block of the encrypted file's data, until it has received all of the file data.
FileIOCompletionRoutineCallback function used with the ReadFileEx and WriteFileEx functions, called when the asynchronous input and output (I/O) operation is completed or canceled.
ImportCallbackCallback function used with WriteEncryptedFileRaw, called one or more times, each time to retrieve a portion of a backup file's data.
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值