File Management Functions
The following functions are used to manage files.
Function | Description |
---|---|
AreFileApisANSI | Determines whether the file I/O functions are using the ANSI or OEM character set code page. |
CheckNameLegalDOS8Dot3 | Determines whether a specified name can be used to create a file on a FAT file system. |
CloseHandle | Closes an open object handle. |
CopyFile | Copies an existing file to a new file. |
CopyFileEx | Copies an existing file to a new file, and notifies an application of the progress through a callback function. |
CopyFileTransacted | Copies an existing file to a new file as a transacted operation, notifying the application of its progress through a callback function. |
CreateFile | Creates or opens a file, directory, physical disk, volume, console buffer, tape drive, communications resource, mailslot, or named pipe. |
CreateFileTransacted | Creates or opens a file, file stream, directory, physical disk, volume, console buffer, tape drive, communications resource, mailslot, or named pipe as a transacted operation. |
CreateHardLink | Establishes a hard link between an existing file and a new file. |
CreateHardLinkTransacted | Establishes a hard link between an existing file and a new file as a transacted operation. |
CreateSymbolicLink | Creates a symbolic link. |
CreateSymbolicLinkTransacted | Creates a symbolic link as a transacted operation. |
DeleteFile | Deletes an existing file. |
DeleteFileTransacted | Deletes an existing file as a transacted operation. |
FindClose | Closes a file search handle that the FindFirstFile, FindFirstFileEx, or FindFirstStreamW function opens. |
FindFirstFile | Searches a directory for a file or subdirectory name that matches a specified name. |
FindFirstFileEx | Searches a directory for a file or subdirectory name and attributes that match those that are specified. |
FindFirstFileNameTransactedW | Creates 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. |
FindFirstFileNameW | Creates 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. |
FindFirstFileTransacted | Searches a directory for a file or subdirectory with a name that matches a specific name as a transacted operation. |
FindFirstStreamTransactedW | Enumerates the first stream in the specified file or directory as a transacted operation. |
FindFirstStreamW | Enumerates the first stream in a specified file or directory. |
FindNextFile | Continues a file search. |
FindNextStreamW | Continues a stream search. |
GetBinaryType | Determines whether a file is executable. If the file is executable, this function determines the type of executable file. |
GetCompressedFileSize | Retrieves the actual number of disk storage bytes that are used to store a specified file. |
GetCompressedFileSizeTransacted | Retrieves the actual number of bytes of disk storage used to store a specified file as a transacted operation. |
GetFileAttributes | Retrieves a set of FAT file system attributes for a specified file or directory. |
GetFileAttributesEx | Retrieves attributes for a specified file or directory. |
GetFileAttributesTransacted | Retrieves a set of FAT file system attributes for a specified file or directory as a transacted operation. |
GetFileBandwidthReservation | Retrieves the bandwidth reservation properties of the volume on which the specified file resides. |
GetFileInformationByHandle | Retrieves file information for a specified file. |
GetFileInformationByHandleEx | Retrieves file information for the specified file. |
GetFileSize | Retrieves the size of a specified file. The file size that can be reported by this function is limited to a DWORD value. |
GetFileSizeEx | Retrieves the size of a specified file. |
GetFileType | Retrieves the file type of a specified file. |
GetFinalPathNameByHandle | Retrieves the final filesystem path for the specified file. |
GetFullPathName | Retrieves the full path and file name of a specified file. |
GetFullPathNameTransacted | Retrieves the full path and file name of a specified file as a transacted operation. |
GetLongPathName | Converts a specified path to its long form. |
GetLongPathNameTransacted | Converts the specified path to its long form as a transacted operation. |
GetShortPathName | Retrieves the short path form of a specified path. |
GetTempFileName | Creates a name for a temporary file. |
GetTempPath | Retrieves the path of the directory that is designated for temporary files. |
MoveFile | Moves an existing file or directory and its children. |
MoveFileEx | Moves an existing file or directory. |
MoveFileTransacted | Moves an existing file or a directory, including its children, as a transacted operation. |
MoveFileWithProgress | Moves a file or directory. You can provide a callback function that receives progress notifications. |
OpenFile | Creates, opens, reopens, or deletes a file. |
OpenFileById | Opens the file that matches the specified identifier. |
ReOpenFile | Reopens a specified file system object with different access rights, a different sharing mode, and different flags than it was previously opened with. |
ReplaceFile | Replaces one file with a different file, and optionally creates a backup copy of the original file. |
RtlIsNameLegalDOS8Dot3 | Determines whether or not a specified name can be used to create a file on the FAT file system. |
SearchPath | Searches for a specified file in a specified path. |
SetFileApisToANSI | Indicates that the file I/O functions must use the ANSI character set code page. |
SetFileApisToOEM | Causes the file I/O functions to use the OEM character set code page. |
SetFileAttributes | Sets the attributes of a file. |
SetFileAttributesTransacted | Sets the attributes for a file or directory as a transacted operation. |
SetFileBandwidthReservation | Requests that bandwidth for the specified file stream be reserved. |
SetFileInformationByHandle | Sets the information for the specified file. |
SetFileShortName | Sets the short name for a specified file. |
SetFileValidData | Sets the valid data length of a specified file. |
The following functions are used with file I/O.
Function | Description |
---|---|
CancelIo | Cancels all pending I/O operations that are issued by the calling thread for a specified file handle. |
CancelIoEx | Marks 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. |
CancelSynchronousIo | Marks pending synchronous I/O operations that are issued by the specified thread as canceled. |
CreateIoCompletionPort | Associates 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. |
FlushFileBuffers | Flushes the buffers for a specified file, and causes all buffered data to be written to the file. |
GetQueuedCompletionStatus | Attempts to dequeue an I/O completion packet from a specified I/O completion port. |
GetQueuedCompletionStatusEx | Retrieves multiple completion port entries simultaneously. |
LockFile | Locks a specified file for exclusive access by the calling process. |
LockFileEx | Locks a specified file for exclusive access by the calling process. This function can operate synchronously or asynchronously. |
PostQueuedCompletionStatus | Posts an I/O completion packet to an I/O completion port. |
ReadFile | Reads data from a file, starting at the position that is indicated by a file pointer. This function can operate synchronously and asynchronously. |
ReadFileEx | Reads data from a file asynchronously. |
ReadFileScatter | Reads data from a file and stores it in an array of buffers. |
SetEndOfFile | Moves the end-of-file position for a specified file to the current position of a file pointer. |
SetFileCompletionNotificationModes | Sets the notification modes for a file handle. |
SetFileIoOverlappedRange | Associates a virtual address range with a file handle. |
SetFilePointer | Moves the file pointer of an open file. |
SetFilePointerEx | Moves the file pointer of a specified file. |
UnlockFile | Unlocks a region in an open file. |
UnlockFileEx | Unlocks a region in an open file. This function can operate synchronously or asynchronously. |
WriteFile | Writes data to a file at a position that a file pointer specifies. This function can operate synchronously and asynchronously. |
WriteFileEx | Writes 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. |
WriteFileGather | Retrieves data from an array of buffers, and then writes the data to a file. |
The following functions are used with the encrypted file system.
Function | Description |
---|---|
AddUsersToEncryptedFile | Adds user keys to a specified encrypted file. |
CloseEncryptedFileRaw | Closes an encrypted file after a backup or restore operation, and frees the associated system resources. |
DecryptFile | Decrypts an encrypted file or directory. |
DuplicateEncryptionInfoFile | Copies the EFS metadata from one file or directory to another. |
EncryptFile | Encrypts a file or directory. |
EncryptionDisable | Disables or enables encryption of a specified directory and the files in the directory. |
FileEncryptionStatus | Retrieves the encryption status of a specified file. |
FreeEncryptionCertificateHashList | Frees a certificate hash list. |
OpenEncryptedFileRaw | Opens an encrypted file to backup (export) or restore (import) the file. |
QueryRecoveryAgentsOnEncryptedFile | Retrieves a list of recovery agents for a specified file. |
QueryUsersOnEncryptedFile | Retrieves a list of users for a specified file. |
ReadEncryptedFileRaw | Backs up (exports) encrypted files. |
RemoveUsersFromEncryptedFile | Removes specified certificate hashes from a specified file. |
SetUserFileEncryptionKey | Sets a current user key to a specified certificate. |
WriteEncryptedFileRaw | Restores (imports) encrypted files. |
The following functions are used with the file system redirector.
Function | Description |
---|---|
Wow64DisableWow64FsRedirection | Disables file system redirection for the calling thread. |
Wow64EnableWow64FsRedirection | Enables or disables file system redirection for the calling thread. |
Wow64RevertWow64FsRedirection | Restores file system redirection for the calling thread. |
The following functions are used to decompress files that are compressed by the Lempel-Ziv algorithm.
Function | Description |
---|---|
GetExpandedName | Retrieves the original name of a compressed file, only if the file is compressed by the Lempel-Ziv algorithm. |
LZClose | Closes a file that was opened by using the LZOpenFile function. |
LZCopy | Copies a source file to a destination file. |
LZInit | Allocates memory for the internal data structures that are required to decompress files, and then creates and initializes the files. |
LZOpenFile | Creates, opens, reopens, or deletes a specified file. |
LZRead | Reads a specified number of bytes from a file and copies them into a buffer. |
LZSeek | Moves a file pointer a specified number of bytes from a starting position. |
The following callback functions are used in file I/O.
Function | Description |
---|---|
CopyProgressRoutine | Callback function used with the CopyFileEx and MoveFileWithProgress functions, called when a portion of a copy or move operation is completed. |
ExportCallback | Callback 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. |
FileIOCompletionRoutine | Callback function used with the ReadFileEx and WriteFileEx functions, called when the asynchronous input and output (I/O) operation is completed or canceled. |
ImportCallback | Callback function used with WriteEncryptedFileRaw, called one or more times, each time to retrieve a portion of a backup file's data. |