C-based file operations
In ANSI C, the operation of the file is divided into two ways, that is, streaming file operations and I/O file operations, respectively, described below.
One, streaming file operation
The file operations in this way have an
So far, the input and output we have discussed is the object of the system-specified standard device (the input device is the keyboard and the output device is the monitor). In real-world applications, disk files are often used as objects. The data
Fgets (read a string from the file)Related functions: open, fread, fscanf, GETCHeader file include Define the function char * fgets (char * s, int size, file * stream );Function Description: fgets () is used to read characters from the file referred
FILE descriptor and FILE, FILE descriptor FILE1. file descriptor (important)
In Linux, everything can be viewed as a file, which can be divided into common files, directory files, link files, and device files. File descriptor is an index created by
1
C file operations
FileBasic concepts of FilesThe so-called "file" refers to an ordered set of related data. This dataset has a name called a file name. In fact, we have used files many times in the
Linux virtual file system four main objects:1) Super Block2) Index node (inode)3) Catalog entry (dentry)4) Document object (file)A process that refers to various objects as it operates on a file is as follows:by Task_struct get files_struct, then
Linux file type and vice file name
Always emphasize a concept, that is: Any device under Linux are files, not only that, even the interface of data communication has a proprietary file in charge ~ So, you will? solution, Linux file type is really a
fopen (Open file)Correlation function Open,fclose
Table header file #include
Defines the function FILE * fopen (const char * path,const char * mode);
The function description parameter path string contains the file path and filename to open, and
It mainly includes php file processing, file processing, file pointer-related processing functions, file control functions, including PHP file processing, file processing, file pointer-related processing functions, and file control functions.
PHP
Java File class learning notes 2: File class objects and common operation methods, file learning notes
1. File, relative path, and absolute path
1. File(1) standard files: such as images and music files.(2) directory file: a folder.(3) virtual
fopen (Open file)Correlation function Open,fcloseTable header file #include Defines the function FILE * fopen (const char * path,const char * mode);Function description The path string contains the file path and filename to open, and the parameter
fopen (Open file)Correlation function Open,fcloseTable header file #include Defines the function FILE * fopen (const char * path,const char * mode);Function description The path string contains the file path and filename to open, and the parameter
Common file extensions and descriptions
A
ACE: Ace compressed file format
Act: Microsoft Office Assistant File
AIF, AIFF: Audio Interchange File, audio format of the silicon graphic and Macintosh Application
Ani: animated cursor in Windows
Arc: LH
fopen (Open file)
Correlation function Open,fclose
Table header file #include
Defines the function FILE * fopen (const char * path,const char * mode);
Function description The path string contains the file path and filename to open, and the
This article tags: getting started with Linux Linux system Linux file system Linux Linux Common command internet TalkLinux system information is stored in a file, and the file is similar to ordinary official documents. Each file
Common Linux C functions-File Content operations-general Linux technology-Linux programming and kernel information. For more information, see the following. Clearerr (error flag for clearing file streams)
Feof
Header file # include
Define the
Linux-fopen-fclose-fread-fwrite and other functions
Clearerr (error flag for clearing file streams)
Related functions
Feof
Header file
# Include
Define functions
Void clearerr (File * stream );
Function Description
Clearerr () clears the error
File type, C language file read/write, File Buffer, file opening method, file operation functionFile types include stream files and device files. device files such as VGA interfaces, serial ports, USB ports, network ports, and serial ports are
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.