0% found this document useful (0 votes)
19 views3 pages

Basic Js

The document discusses files, what they are, how data is stored in files, how to read data from files, and what file pointers are. Files are used to permanently store different types of data like text, images, audio, and video on a computer's hard disk. A file pointer keeps track of position when reading through the contents of a file from start to end.

Uploaded by

jiya99704
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views3 pages

Basic Js

The document discusses files, what they are, how data is stored in files, how to read data from files, and what file pointers are. Files are used to permanently store different types of data like text, images, audio, and video on a computer's hard disk. A file pointer keeps track of position when reading through the contents of a file from start to end.

Uploaded by

jiya99704
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

File Introduction

le-handler=open( lename, mode)

What are les ?

• Files are used permanently in our laptop or computer is in hard disk drive(HDD)

• on this hard disk we stored the data in the form of les

What type of Data is stored in les


• It can be stored in the form of text, image les, audio les or a movie le.

• Files on the hard disk can be identi ed by their names.

• And located at some place where we required path

• If we know the le. The program can access the le using path.

How to read the data from le

Program:

Input:
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
Output:

This is a test le
it is stored in hard disk

What is le Pointer:

• Imagine this list as a long strip of characters we can also called it as an array of characters.

• File pointer keeps on proving until the last read and moves to the next character

• File pointer starts at beginning and ends at the end of le.

Program:

Input:
fi
fi
fi
Output:
This i
s a test

• Whenever a person opens a le one should make sure to close it properly.


le_handler.close()

• File is like a resource for a program

• File is an external part of program not a core part of program


fi
fi

You might also like