Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit focus mode

File Management Functions

  • 2025-03-31
Feedback

In this article

The following functions are used to manage files.

In this section

FunctionDescription
AddUsersToEncryptedFileAdds user keys to the specified encrypted file.
AreFileApisANSIDetermines whether the file I/O functions are using the ANSI or OEM character set code page.
CancelIoCancels all pending input and output (I/O) operations that are issued by the calling thread for the specified file.
CancelIoExMarks any outstanding I/O operations for the specified file handle. The function only cancels I/O operations in the current process, regardless of which thread created the I/O operation.
CancelSynchronousIoMarks pending synchronous I/O operations that are issued by the specified thread as canceled.
CheckNameLegalDOS8Dot3Determines whether the specified name can be used to create a file on a FAT file system.
CloseEncryptedFileRawCloses an encrypted file after a backup or restore operation, and frees associated system resources.
CopyFileCopies an existing file to a new file.
CopyFile2Copies an existing file to a new file, notifying the application of its progress through a callback function.
PCOPYFILE2_PROGRESS_ROUTINEAn application-defined callback function used with theCopyFile2 function.
CopyFileExCopies an existing file to a new file, notifying the application of its 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.
CopyProgressRoutineAn application-defined callback function used with theCopyFileEx,MoveFileTransacted, andMoveFileWithProgress functions.
CreateFileCreates or opens a file or I/O device. The most commonly used I/O devices are as follows: file, file stream, directory, physical disk, volume, console buffer, tape drive, communications resource, mailslot, and pipe.
CreateFile2Creates or opens a file.
CreateFile3Creates or opens a file.
CreateFileTransactedCreates or opens a file, file stream, or directory 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.
CreateIoCompletionPortCreates an input/output (I/O) completion port and associates it with a specified file handle, or creates an I/O completion port that is not yet associated with a file handle, allowing association at a later time.
CreateSymbolicLinkCreates a symbolic link.
CreateSymbolicLinkTransactedCreates a symbolic link as a transacted operation.
DecryptFileDecrypts an encrypted file or directory.
DeleteFileDeletes an existing file.
DeleteFile2Deletes an existing file.
DeleteFileTransactedDeletes an existing file as a transacted operation.
DuplicateEncryptionInfoFileCopies the EFS metadata from one file or directory to another.
EncryptFileEncrypts a file or directory.
EncryptionDisableDisables or enables encryption of the specified directory and the files in it.
ExportCallbackAn application-defined callback function used withReadEncryptedFileRaw.
FileEncryptionStatusRetrieves the encryption status of the specified file.
FileIOCompletionRoutineAn application-defined callback function used with theReadFileEx andWriteFileEx functions. It is called when the asynchronous input and output (I/O) operation is completed or canceled and the calling thread is in an alertable state.
FindCloseCloses a file search handle opened by theFindFirstFile,FindFirstFileEx,FindFirstFileNameW,FindFirstFileNameTransactedW,FindFirstFileTransacted,FindFirstStreamTransactedW, orFindFirstStreamW functions.
FindFirstFileSearches a directory for a file or subdirectory with a name that matches a specific name (or partial name if wildcards are used).
FindFirstFileExSearches a directory for a file or subdirectory with a name and attributes that match those 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 theFindNextFileNameW function.
FindFirstFileNameWCreates an enumeration of all the hard links to the specified file. TheFindFirstFileNameW function returns a handle to the enumeration that can be used on subsequent calls to theFindNextFileNameW 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 with a ::$DATA stream type in the specified file or directory.
FindNextFileContinues a file search from a previous call to theFindFirstFile,FindFirstFileEx, orFindFirstFileTransacted functions.
FindNextFileNameWContinues enumerating the hard links to a file using the handle returned by a successful call to theFindFirstFileNameW function.
FindNextStreamWContinues a stream search started by a previous call to theFindFirstStreamW function.
FlushFileBuffersFlushes the buffers of a specified file and causes all buffered data to be written to a file.
FreeEncryptionCertificateHashListFrees a certificate hash list.
GetBinaryTypeDetermines whether a file is an executable (.exe) file, and if so, which subsystem runs the executable file.
GetCompressedFileSizeRetrieves the actual number of bytes of disk storage 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.
GetExpandedNameRetrieves the original name of a compressed file, if the file was compressed by the Lempel-Ziv algorithm.
GetFileAttributesRetrieves file system attributes for a specified file or directory.
GetFileAttributesExRetrieves attributes for a specified file or directory.
GetFileAttributesTransactedRetrieves 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 the specified file.
GetFileInformationByHandleExRetrieves file information for the specified file.
GetFileSizeRetrieves the size of the specified file, in bytes.
GetFileSizeExRetrieves the size of the specified file.
GetFileTypeRetrieves the file type of the specified file.
GetFinalPathNameByHandleRetrieves the final path for the specified file.
GetFullPathNameRetrieves the full path and file name of the specified file.
GetFullPathNameTransactedRetrieves the full path and file name of the specified file as a transacted operation.
GetLongPathNameConverts the specified path to its long form.
GetLongPathNameTransactedConverts the specified path to its long form as a transacted operation.
GetQueuedCompletionStatusAttempts to dequeue an I/O completion packet from the specified I/O completion port.
GetQueuedCompletionStatusExRetrieves multiple completion port entries simultaneously.
GetShortPathNameRetrieves the short path form of the specified path.
GetTempFileNameCreates a name for a temporary file. If a unique file name is generated, an empty file is created and the handle to it is released; otherwise, only a file name is generated.
GetTempPathRetrieves the path of the directory designated for temporary files.
ImportCallbackAn application-defined callback function used withWriteEncryptedFileRaw. The system callsImportCallback one or more times, each time to retrieve a portion of a backup file's data.
LockFileLocks the specified file for exclusive access by the calling process.
LockFileExLocks the specified file for exclusive access by the calling process. This function can operate either synchronously or asynchronously and can request either an exclusive or a shared lock.
LZCloseCloses a file that was opened by using theLZOpenFile function.
LZCopyCopies a source file to a destination file.
LZInitAllocates memory for the internal data structures required to decompress files, and then creates and initializes them.
LZOpenFileCreates, opens, reopens, or deletes the specified file.
LZReadReads (at most) the specified number of bytes from a file and copies them into a buffer.
LZSeekMoves a file pointer the specified number of bytes from a starting position.
MoveFileMoves an existing file or a directory, including its children.
MoveFileExMoves an existing file or directory, including its children, with various move options.
MoveFileTransactedMoves an existing file or a directory, including its children, as a transacted operation.
MoveFileWithProgressMoves a file or directory, including its children. You can provide a callback function that receives progress notifications.
OpenEncryptedFileRawOpens an encrypted file in order to backup (export) or restore (import) the file.
OpenFileCreates, opens, reopens, or deletes a file.
OpenFileByIdOpens the file that matches the specified identifier.
PostQueuedCompletionStatusPosts an I/O completion packet to an I/O completion port.
QueryRecoveryAgentsOnEncryptedFileRetrieves a list of recovery agents for the specified file.
QueryUsersOnEncryptedFileRetrieves a list of users for the specified file.
ReadEncryptedFileRawBacks up (export) encrypted files.
ReadFileReads data from the specified file or input/output (I/O) device. Reads occur at the position specified by the file pointer if supported by the device.
ReadFileExReads data from the specified file or input/output (I/O) device. It reports its completion status asynchronously, calling the specified completion routine when reading is completed or canceled and the calling thread is in an alertable wait state.
ReadFileScatterReads data from a file and stores it in an array of buffers.
RemoveUsersFromEncryptedFileRemoves specified certificate hashes from a specified file.
ReOpenFileReopens the specified file system object with different access rights, sharing mode, and flags.
ReplaceFileReplaces one file with another file, with the option of creating a backup copy of the original file.
SearchPathSearches for a specified file in a specified path.
SetEndOfFileSets the physical file size for the specified file to the current position of the file pointer.
SetFileApisToANSICauses the file I/O functions to use the ANSI character set code page for the current process.
SetFileApisToOEMCauses the file I/O functions for the process to use the OEM character set code page.
SetFileAttributesSets the attributes for a file or directory.
SetFileAttributesTransactedSets the attributes for a file or directory as a transacted operation.
SetFileBandwidthReservationRequests that bandwidth for the specified file stream be reserved. The reservation is specified as a number of bytes in a period of milliseconds for I/O requests on the specified file handle.
SetFileCompletionNotificationModesSets the notification modes for a file handle, allowing you to specify how completion notifications work for the specified file.
SetFileInformationByHandleSets the file information for the specified file.
SetFileIoOverlappedRangeAssociates a virtual address range with the specified file handle.
SetFilePointerMoves the file pointer of the specified file.
SetFilePointerExMoves the file pointer of the specified file.
SetFileShortNameSets the short name for the specified file.
SetFileValidDataSets the valid data length of the specified file. This function is useful in very limited scenarios. For more information, see the Remarks section.
SetSearchPathModeSets the per-process mode that theSearchPath function uses when locating files.
SetUserFileEncryptionKeySets the user's current key to the specified certificate.
UnlockFileUnlocks a region in an open file.
UnlockFileExUnlocks a region in the specified file. This function can operate either synchronously or asynchronously.
WofEnumEntriesEnumerates all the data sources from a specified provider for a specified volume.
WofEnumEntryProcCallback function that gets called for each data source in response to a call toWofEnumEntries.
WofEnumFilesProcCallback function that gets called for each file backed by an external data source, such as a WIM file.
WofFileEnumFilesEnumerates all of the files which are compressed with a specified compression algorithm on a specified volume.
WofGetDriverVersionUsed to query the version of the driver used to support a particular provider.
WofIsExternalFileUsed to determine if a file is being backed by a physical file or is backed by a system data provider, and optionally indicates which provider or additional data about the file.
WofSetFileDataLocationUsed to change a file from being backed by a physical file to one backed by a system data provider.
WofShouldCompressBinariesIndicates whether compression should be used on a particular volume, and if so, which compression algorithm should be used.
WofWimAddEntryAdds a single WIM data source to a volume such that files can be created on the volume which are stored within the WIM.
WofWimEnumFilesEnumerates all of the files which are being backed by a specified WIM data source on a specified volume.
WofWimRemoveEntryRemoves a single WIM data source from backing files on a volume.
WofWimSuspendEntryTemporarily removes a WIM data source from backing files on a volume until the volume is remounted or the data source is updated withWofWimUpdateEntry.
WofWimUpdateEntryUpdates a WIM entry to point to a different WIM file location.
Wow64DisableWow64FsRedirectionDisables file system redirection for the calling thread. File system redirection is enabled by default.
Wow64EnableWow64FsRedirectionEnables or disables file system redirection for the calling thread.
Wow64RevertWow64FsRedirectionRestores file system redirection for the calling thread.
WriteEncryptedFileRawRestores (import) encrypted files.
WriteFileWrites data to the specified file or input/output (I/O) device.
WriteFileExWrites data to the specified file or input/output (I/O) device. It reports its completion status asynchronously, calling the specified completion routine when writing is completed or canceled and the calling thread is in an alertable wait state.
WriteFileGatherRetrieves data from an array of buffers and writes the data to a file.

The following functions are used with file I/O.

CancelIo
CancelIoEx
CancelSynchronousIo
CreateIoCompletionPort
FlushFileBuffers
GetQueuedCompletionStatus
GetQueuedCompletionStatusEx
LockFile
LockFileEx
PostQueuedCompletionStatus
ReadFile
ReadFileEx
ReadFileScatter
SetEndOfFile
SetFileCompletionNotificationModes
SetFileIoOverlappedRange
SetFilePointer
SetFilePointerEx
UnlockFile
UnlockFileEx
WriteFile
WriteFileEx
WriteFileGather

The following functions are used with the encrypted file system.

AddUsersToEncryptedFile
CloseEncryptedFileRaw
DecryptFile
DuplicateEncryptionInfoFile
EncryptFile
EncryptionDisable
FileEncryptionStatus
FreeEncryptionCertificateHashList
OpenEncryptedFileRaw
QueryRecoveryAgentsOnEncryptedFile
QueryUsersOnEncryptedFile
ReadEncryptedFileRaw
RemoveUsersFromEncryptedFile
SetUserFileEncryptionKey
WriteEncryptedFileRaw

The following functions are used with thefile system redirector.

Wow64DisableWow64FsRedirection
Wow64EnableWow64FsRedirection
Wow64RevertWow64FsRedirection

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

GetExpandedName
LZClose
LZCopy
LZInit
LZOpenFile
LZRead
LZSeek

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

CopyProgressRoutine
ExportCallback
FileIOCompletionRoutine
ImportCallback


Feedback

Was this page helpful?

YesNo

In this article

Was this page helpful?

YesNo