Definition: A software entity such as classes, modules, and functions should be open to extensions and closed for modification. The problem: in the lifecycle of the software, changes, upgrades, and maintenance, for reasons that require
(i) Open and close files 1, sequential filesTo open the sequential file, we can use the Open statement. It has the following format:Open pathname for [Input | Output | Append] as [#]filenumber [Len = buffersize]Description(1) Parameter pathname
1. file stream
Ofstream, derived from ostream, used to write filesIfstream, derived from istream, used to read filesFstream, derived from iostream, is used to read and write files.
Ii. Open a file
After the stream object is described, you can use
I. file descriptor
For Linux, all operations on devices or files are performed through file descriptors. When a file is opened or created, the kernel returns a file descriptor (non-negative integer) to the process ). Subsequent operations on the
Text files are a powerful system management tool for system administrators. This seems impossible for the current advanced graphic interface and multi-user operating systems. However, simple text files, such as NotePad files, are still a key
This article mainly introduces the summary of PHP open and close File operation functions. This article describes fopen () and fclose () functions, which focus on fopen () functions, if you need a file, you can refer to the following: before
(FileStream, StreamWriter, StreamReader, File, FileInfo, Directory, DirectoryInfo, Path, Encoding)C # files and streams (FileStream, StreamWriter, StreamReader, file, FileInfo, Di, you can refer to the required friends. Files and Streams (FileStream,
Document directory
Open a file)
Close a file)
Text mode files)
Verification of state flags)
Get and put stream pointers)
Binary files)
Cache and synchronization (buffers and synchronization)
C ++ supports file input and output through the
Reprint please indicate source: http://blog.csdn.net/u011974987/article/details/52354074This article is from: "Xuhao's Blog"
opening and closing of C language filesIn the C language, the file operation is done by the library function, we will
1 Open FileBefore reading or writing to the file, the first problem is how to connect the files that are read and written in the program to the actual data files on the disk. In the C language, this is not difficult, just call the C-language library
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.