Windows API Reference

File Management API Reference

This section provides comprehensive documentation for the Windows API functions related to file management operations. These APIs allow applications to interact with the file system, manage files and directories, and perform various storage-related tasks.

Core File Operations

These functions provide fundamental capabilities for working with files:

  • CreateFile: Creates or opens a file or device.
  • ReadFile: Reads data from a file or device.
  • WriteFile: Writes data to a file or device.
  • CloseHandle: Closes an open object handle.
  • DeleteFile: Deletes a file.
  • CopyFile: Copies an existing file to a new file.
  • MoveFile: Moves an existing file or directory.

Directory Management

Functions for managing directories and their contents:

  • CreateDirectory: Creates a new directory.
  • RemoveDirectory: Removes an existing directory.
  • FindFirstFile / FindNextFile: Retrieves information about files in a directory.
  • GetFileAttributes: Retrieves attributes for a specified file or directory.
  • SetFileAttributes: Sets the attributes for a specified file or directory.

File I/O Advanced Features

Explore more advanced file I/O functionalities:

  • ReadFileEx / WriteFileEx: Asynchronous read and write operations.
  • SetFilePointer: Moves the file pointer.
  • LockFile: Locks a region of a file.
  • UnlockFile: Unlocks a region of a file.

Special File System Operations

Accessing specific file system features:

Function Description
GetLogicalDrives Retrieves a bitmask of all the logical drives available on the system.
GetVolumeInformation Retrieves information about a file system and the file system volume.
GetDiskFreeSpace Retrieves information about the specified disk, including the amount of free space available.
CreateHardLink Creates a hard link to an existing file.
CreateSymbolicLink Creates a symbolic link to an existing file or directory.

Further Reading

For a complete list of file management functions, please refer to the Windows API Index.