0% found this document useful (0 votes)
55 views16 pages

Handling Computer Files (Teachers Guide)

teaches how to handle computer files(nigerian syllabus)

Uploaded by

praise
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)
55 views16 pages

Handling Computer Files (Teachers Guide)

teaches how to handle computer files(nigerian syllabus)

Uploaded by

praise
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
You are on page 1/ 16

You Are

Welcome To
Class
January, 2024

Year One
TOPIC:
Handling
Computer Files
LEARNING
OBJECTIVES

At the end of the lesson, I should be able to:


• List basic operations on file
• Create sequential file
• Access a sequential file
• Read and display content of files
Class Activity
Explain the following types of files
1.System file
2.Program files
3.Document files
4.Multimedia files
5.Emails files
Definition of File

A file is a chunk of information stored in


a computer. The word file is used in an
office setting. Information is traditionally
stored on paper and those papers are
grouped into files, stored in a file cabinet.
File Contents
On the atomic level, all the information in a file is binary, or
just a series of ones and zeroes. E.g
111000001110001010000100000100001111111111

A document includes any file you have created. It can be a


true text. Documents can also be sound files, graphics images.

Program Files: A program file contain instructions for the


computer’s microprocessor., they tell the computer what to do.

Data Files: A data file includes all other files on disk that are
not exactly programs or documents. These include support files
for programs, temporary files and other random files that must
be saved inside the computer.
FILE OPERATION
Basic operations in computer files include:

1. Create: Creating a file with a given name.


2. Delete: Deleting an unwanted file.
3. Retrieve: retrieving a stored file or lose file.
4. Copy: Copying a created file to either an
external or in-built storage device.
5. View: Viewing a created file
6. Open: Opening a file to use its contents.
7. Update: Updating the contents.
8. Close: Closing the file.
COMPUTER FILES

Computer files are the type of files that are made


on a computer and are stored in the form of a soft
copy. These types of files have a lot of protection
as they are secured by different passwords and
codes.
Steps in creating Sequential File
The open statement is used for writing information to a file.
In general, the open statement follows this pattern.

OPEN files$ FOR OUTPUT AS #1

The files$ determines the filename use. Th FOR portion


indicates how the file will be accessed or operated. AS # is
the identifier used for the file handle in question.
Example:
The following opens a file, using
mode OUTPUT and number 1,
and then saves the text
HelloWorld! to the file.
10 CLS
20 OPEN “testfile.dat” FOR OUTPUT AS #1
30 PRINT #1, “Hello World!”
40 CLOSE #1
50 END
Steps involved in accessing Sequential File in BASIC

The open statement is also used for reading


information from a file.

OPEN file$ FOR INPUT AS #1


The files$ determines the filename use. Th
FOR portion indicates how the file will be
accessed or operated. AS # is the identifier
used for the file handle in question.
Example:

To open a file for “reading” call


OPEN and pass INPUT as the file
mode. Then you can read the data
by using the INPUT command.
10 CLS
20 OPEN “testfile.dat” FOR INPUT AS #1
30 INPUT #1, text$
40 CLOSE #1
50 PRINT text$
60 END
HOME WORK

1. Outline steps to be taken


when creating a sequential
file.

You might also like