文件存储:File I\O

  • A file is the basic unit of storage that enables a computer to distinguish one set of information from another. This overview describes the file input and output (I/O) operations and the information provided by the file I/O functions. 文件是使计算机能够将一组信息与另一组信息区别开来的基本存储单元。这个概述描述了文件输入和输出(I/O)操作以及文件I/O函数提供的信息
  • For more information about the file system and its features, see File Systems. 有关文件系统及其特性的更多信息,请参见文件系统。

About File I/O

Using File I/O

File I/O Reference

  • The following elements are used with file I/O. 以下元素用于文件I/O

File I/O Functions

  • The following functions are used with files.

AreFileApisANSI

  • Determines whether the file I/O functions are using the ANSI or OEM character set code page. 确定文件I/O函数是否使用ANSI或OEM字符集代码页。

CancelIo

  • Cancels all pending I/O operations that were issued by the calling thread for the specified file handle. 取消调用线程为指定文件句柄发出的所有挂起的I/O操作

CloseHandle

  • Closes an open object handle. 关闭打开的对象句柄

CopyFile

  • Copies an existing file to a new file. 将现有文件复制到新文件

CopyFileEx

  • Copies an existing file to a new file. 将现有文件复制到新文件。

CopyProgressRoutine

  • An application-defined callback function used with ### CopyFileEx and MoveFileWithProgress.一个应用程序定义的回调函数,用于CopyFileEx和MoveFileWithProgress。

CreateDirectory

  • Creates a new directory. 创建一个新目录

CreateDirectoryEx

  • Creates a new directory with the attributes of a specified template directory.使用指定模板目录的属性创建新目录

CreateFile

  • Creates or opens a file object. 创建或打开文件对象。

CreateIoCompletionPort

  • Creates and I/O completion port or associates an instance of an opened file with a newly created or an existing I/O completion port.创建和I/O完成端口,或将打开的文件实例与新创建的或现有的I/O完成端口关联

DefineDosDevice

Defines, redefines, or deletes MS-DOS device names. 定义、重定义或删除MS-DOS设备名称

DeleteFile

Deletes an existing file. 删除现有文件。

FileIOCompletionRoutine

An application-defined callback function used with ReadFileEx and WriteFileEx. 与ReadFileEx和WriteFileEx一起使用的应用程序定义的回调函数。

FindClose

Closes the specified search handle. 关闭指定的搜索句柄

FindCloseChangeNotification

Stops change notification handle monitoring. 停止更改通知处理监视

FindFirstChangeNotification

Creates a change notification handle. 创建变更通知句柄

FindFirstFile

  • Searches a directory for a file whose name matches the specified file name. 搜索名称与指定文件名匹配的文件的目录。

FindFirstFileEx

  • Searches a directory for a file whose name and attributes match those specified.在目录中搜索名称和属性与指定名称和属性匹配的文件。

FindNextChangeNotification

  • Requests that the operating system signal a change notification handle the next time it detects an appropriate change. 请求操作系统发出更改通知信号,以便下次检测到适当的更改时处理该更改

FindNextFile

  • Continues a file search. 继续文件搜索。

FlushFileBuffers

  • Clears the buffers for the specified file and causes all buffered data to be written to the file. 清除指定文件的缓冲区,并将所有缓冲数据写入该文件

GetBinaryType

  • Determines whether a file is executable. 确定文件是否可执行

GetCurrentDirectory

  • Retrieves the current directory for the current process.检索当前进程的当前目录

GetDiskFreeSpace

  • Retrieves information about the specified disk, including the amount of free space on the disk. 检索有关指定磁盘的信息,包括磁盘上的可用空间量

GetDiskFreeSpaceEx

  • Retrieves information about the specified disk, including the amount of free space on the disk. 检索有关指定磁盘的信息,包括磁盘上的可用空间量

GetDriveType

  • Determines whether a disk drive is a removable, fixed, CD-ROM, RAM disk, or network drive. 确定磁盘驱动器是可移动的、固定的、CD-ROM、RAM磁盘还是网络驱动器。

GetFileAttributes

  • Retrieves attributes for a specified file or directory.检索指定文件或目录的属性。

GetFileAttributesEx

  • Retrieves attributes for a specified file or directory. 检索指定文件或目录的属性。

GetFileInformationByHandle

  • Retrieves file information for a specified file.检索指定文件的文件信息

GetFileSize

  • Retrieves the size of a specified file. 检索指定文件的大小

GetFileSizeEx

  • Retrieves the size of a specified file. 检索指定文件的大小。

GetFileType

  • Retrieves the file type of the specified file. 检索指定文件的文件类型

GetFullPathName

  • Retrieves the full path and file name of a specified file. 索指定文件的完整路径和文件名

GetLogicalDrives

  • Returns a bitmask representing the currently available disk drives.返回表示当前可用磁盘驱动器的位掩码

GetLogicalDriveStrings

  • Fills a buffer with strings that specify valid drives in the system. 用指定系统中有效驱动器的字符串填充缓冲区。

GetLongPathName

  • Converts the specified path to its long form. 将指定的路径转换为其长格式

GetQueuedCompletionStatus

  • Attempts to dequeue an I/O completion packet from a specified I/O completion port. 尝试从指定的I/O完成端口将I/O完成包取出队列。

GetShortPathName

  • Retrieves the short path form of a specified input path. 检索指定输入路径的短路径形式。

GetTempFileName

  • Creates a name for a temporary file. 为临时文件创建名称。

GetTempPath

  • Retrieves the path of the directory designated for temporary files. 检索为临时文件指定的目录的路径。

LockFile

  • Locks a region in an open file. 在打开的文件中锁定一个区域

LockFileEx

  • Locks a region in an open file for shared or exclusive access. 在打开的文件中锁定一个区域,以便共享或独占访问

MoveFile

  • Moves an existing file or a directory. 移动现有文件或目录。

MoveFileEx

  • Moves an existing file or a directory. 移动现有文件或目录

MoveFileWithProgress

  • Moves a file or directory. 移动文件或目录

PostQueuedCompletionStatus

  • Posts an I/O completion packet to an I/O completion port. 将I/O完成包发送到I/O完成端口

QueryDosDevice

  • Retrieves information about MS-DOS device names. 检索有关MS-DOS设备名称的信息。

ReadDirectoryChangesW

  • Retrieves information describing the changes occurring within a directory.检索描述目录中发生的更改的信息

ReadFile

  • Reads data from a file, starting at the specified position. 从指定位置开始,从文件中读取数据

ReadFileEx

  • Reads data from a file asynchronously. 异步地从文件中读取数据。
    异步地从文件中读取数据。

ReadFileScatter

  • Reads data from a file and stores the data into a set of buffers. 从文件中读取数据并将数据存储到一组缓冲区中。

RemoveDirectory

  • Deletes an existing empty directory. 删除现有的空目录。

ReplaceFile

  • Replaces one file with another file. 用另一个文件替换一个文件

SearchPath

  • Searches for the specified file.搜索指定的文件。

SetCurrentDirectory

  • Changes the current directory for the current process. 更改当前进程的当前目录

SetEndOfFile

  • Moves the end-of-file position for the specified file. 移动指定文件的文件结束位置。

SetFileApisToANSI

  • Causes the file I/O functions to use the ANSI character set code page. 使文件I/O函数使用ANSI字符集代码页

SetFileApisToOEM

  • Causes the file I/O functions to use the OEM character set code page. 使文件I/O函数使用OEM字符集代码页

SetFileAttributes

  • Sets a file’s attributes. 设置文件的属性。

SetFilePointer

  • Moves the file pointer of an open file. 移动打开文件的文件指针

SetFilePointerEx

  • Moves the file pointer of an open file. 移动打开文件的文件指针

SetFileSecurity

  • Sets the security of a file or directory object. 设置文件或目录对象的安全性

SetFileShortName

  • Sets the valid data length of the specified file. 设置指定文件的有效数据长度

SetFileValidData

  • Sets the valid data length of the specified file. 设置指定文件的有效数据长度

SetVolumeLabel

  • Sets the label of a file system volume. 设置文件系统卷的标签。

UnlockFile

  • Unlocks a previously locked region in an open file. 在打开的文件中解锁先前锁定的区域

UnlockFileEx

  • Unlocks a previously locked region in an open file. 在打开的文件中解锁先前锁定的区域

WriteFile

  • Writes data to a file. 将数据写入文件。

WriteFileEx

  • Writes data to a file asynchronously. 异步地将数据写入文件

WriteFileGather

  • Gathers data from a set of buffers and writes the data to a file. 从一组缓冲区收集数据并将数据写入文件。

File I/O Structures

  • The following structures are used with file I/O.以下结构用于文件I/O

BY_HANDLE_FILE_INFORMATION

FILE_NOTIFY_INFORMATION

OFSTRUCT

WIN32_FILE_ATTRIBUTE_DATA

WIN32_FIND_DATA

File I/O Enumeration Types

  • The following enumeration types are used with file I/O.以下枚举类型用于文件I/O

FINDEX_INFO_LEVELS

  • FINDEX_INFO_LEVELS枚举类型定义了与FindFirstFileEx函数一起使用的值,用于指定返回数据的信息级别
  • Enumeration Values:
    • (FindExInfoStandard):The FindFirstFileEx function retrieves a standard set of attribute information. The data is returned in a WIN32_FIND_DATA structure. FindFirstFileEx函数检索一组标准的属性信息。数据以WIN32_FIND_DATA结构返回
  • Header: Declared in Winbase.h; include Windows.h
typedef enum _FINDEX_INFO_LEVELS { 
  FindExInfoStandard 
} FINDEX_INFO_LEVELS ;

FINDEX_SEARCH_OPS

  • The FINDEX_SEARCH_OPS enumeration type defines values that are used with the FindFirstFileEx function to specify the type of filtering to perform.
  • Enumeration Values
    • FindExSearchNameMatch:Search for a file that matches the specified file name. Note that lpSearchFilter parameter of FindFirstFileEx must be NULL when this search operation is used.搜索与指定文件名匹配的文件。注意,当使用此搜索操作时,FindFirstFileEx的lpSearchFilter参数必须为NULL。
    • FindExSearchLimitToDevices :This filtering type is not available. For information on enumerating devices, see Device Interfaces.此筛选类型不可用。有关枚举设备的信息,请参见设备接口。
    • FindExSearchLimitToDirectories :This is an advisory flag. If the file system supports directory filtering, the function searches for a “file” that matches the specified file name and that is a directory. If the file system does not support directory filtering, this flag is silently ignored. The lpSearchFilter parameter of FindFirstFileEx must be NULL when this search operation is used. If you want directory filtering, use this flag on all file systems, but be sure to examine the file attribute data stored into the lpFindFileData parameter of FindFirstFileEx to determine whether the function has indeed returned a handle to a directory. 这是一个咨询标志。如果文件系统支持目录过滤,该函数将搜索与指定文件名匹配的“文件”,即目录。如果文件系统不支持目录过滤,此标志将被默认忽略。使用此搜索操作时,FindFirstFileEx的lpSearchFilter参数必须为NULL。如果希望对目录进行过滤,请在所有文件系统上使用此标志,但请确保检查存储在FindFirstFileEx的lpFindFileData参数中的文件属性数据,以确定函数是否确实向目录返回了句柄。
  • Header: Declared in Winbase.h; include Windows.h
typedef enum _FINDEX_SEARCH_OPS { 
  FindExSearchNameMatch, 
  FindExSearchLimitToDirectories, 
  FindExSearchLimitToDevices, 
} FINDEX_SEARCH_OPS ;
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值