In VC, most cases of file operation using the system provided API functions, but some of the functions we are not very familiar with, the following provides some file operation API function Introduction:
General file Operations API
CreateFile
Open File
To read and write to a file, you must first obtain a file handle, which allows you to obtain a file handle that is the gateway to the file world.
ReadFile
Reads the byte information from the file.
After you open a file to obtain a file handle, you can read the data through the function.
WriteFile
Writes byte information to a file.
You can also pass a file handle to the function to enable writing to the file data.
CloseHandle
Closes the file handle.
After opening the door, naturally remember to close it.
Getfiletime
Gets the file time.
There are three file time available: Creation time, last access time, last write time.
The function also requires a file handle as the entry parameter.
GetFileSize
Gets the file size.
Since the file size can be as high as the number G (1G requires 30 bits), a 32-bit double-byte type cannot accurately express it, so the return code represents a low 32-bit, and an exit parameter can be higher than 32 digits.
The function also requires a file handle as the entry parameter.
GetFileAttributes
Gets the file properties.
You can get the file's archive, read-only, system, hide, and so on.
This function takes only one file path as an argument.