What is the difference between stream and file?

Standard C talks about threads. For example, the help page fopen(3)says what fopenis a function to open a stream.

Can anyone explain what streams are and how they relate to files?

+8
source share
1 answer

In the context of the C standard library, a stream is a common interface for performing certain I / O operations. You can read from streams, write to streams, some streams are searchable. Opening a file as a stream is the only way to get the stream as an input / output interface for the application.

Let me quote:

11.1.1 Streams and File Descriptors

, : . int, - FILE *.

. , (, ) , . [...]

... :

12.1 Streams

C, , FILE, "". FILE *, " " "". C.

/ C:

:

API API . API , , -, - " " -:

+8

All Articles