Files
CHA PTER O UTLIN E
13.1 Introduction
13.2 Streams and File Types
13.3 Steps for File Operations
13.4
File I/O
13.5 Structures Read and Write
13.6
Other File Function
13.7
Searching Errors in Reading/Writing Files
13.8 Low Level Disk I/O
13.9 Comm and Line Arguments
13.10 Application of Command Line Arguments
13.11 Environment Variables
13.12
I/O Redirection
Exercises
13.1 INTRODUCTION
Applications generally involve tremendous amount of data to be read and written to an auxiliary
storage. Hence to save such information on the disk we use data files. File is a collection of numbers,
symbols & text placed on the disk. In due course of time files can be read and modified as per the
user requirements. Thus, files allow us to store information permanently in the disk; access and
further it can be altered depending upon the needs. This process leads to the concept of data files.
A) Definition of File
File is a set of records that can be accessed through the set of library functions.
13.2 S TR E A M S A ND FILE T YP E S
Stream means reading and writing of data. The streams are designed to allow the user to access the
files efficiently. A stream is a file or physical device like keyboard, printer and monitor. The FILE
object uses these devices.
The FILE object contains all the information about stream like current position, pointer to any
buffer, error and EOF (end of file). Using this information of object, C program uses pointer, which
is returned from stream function f open ().
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.17.18