Introduction to File Operations API functions

Source: Internet
Author: User
Tags file size requires

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.