+ All Categories
Home > Documents > Files concepts.53

Files concepts.53

Date post: 29-Nov-2014
Category:
Upload: myrajendra
View: 418 times
Download: 2 times
Share this document with a friend
Description:
 
25
http://raj- os.blogspot.in/ 1 File Concept, File Management, File Attributes
Transcript
Page 1: Files concepts.53

http://raj-os.blogspot.in/ 1

File Concept, File Management, File Attributes

Page 2: Files concepts.53

http://raj-os.blogspot.in/ 2

Recap

• In the last class, you have learnt

– Various disk scheduling algorithms

– Selection of a particular disk scheduling

algorithm

Page 3: Files concepts.53

• HOME PREVIOUS TOPIC NEXT• PREVIOUS QUESTION PAPERS FOR

OS• CPP TUTORIALS

3http://raj-os.blogspot.in/

Page 4: Files concepts.53

http://raj-os.blogspot.in/ 4

Objectives

On completion of this period you would be able to

know:

- Understand file Concept

- Understand file operations

- Know Various file types

Page 5: Files concepts.53

http://raj-os.blogspot.in/ 5

File Concept

File

- A named collection of related information

- Recorded on secondary storage

User’s perspective

- Smallest allotment of logical secondary storage

Files represent both

- Programs

- Data

Page 6: Files concepts.53

http://raj-os.blogspot.in/ 6

Program Files - Source form - Object form

- Executable form

Data Files - Numeric

- Alphabetic - Alphanumeric

- Binary

File concept

Page 7: Files concepts.53

http://raj-os.blogspot.in/ 7

File Formats

- Free form

Ex. Text files

- Rigidly formatted

File Concept

Page 8: Files concepts.53

http://raj-os.blogspot.in/ 8

Second definition of a file

A file is a sequence of bits, bytes, lines or records

whose meaning is defined by the file’s creator and user

File Concept

Page 9: Files concepts.53

http://raj-os.blogspot.in/ 9

Types of Information in a file

- Source Programs

- Object Programs

- Executable Programs

- Numeric Data

- Text

- Student Records

- Graphic Images

- Sound recordings

- Video recordings

Page 10: Files concepts.53

http://raj-os.blogspot.in/ 10

Structure of a File A file has a defined structure according to its type

Text file A sequence of characters organized into lines or

pages

Source file

- A sequence of subroutines and

functions

- Each of which is further organized as

declarations followed by executable

statements

Page 11: Files concepts.53

http://raj-os.blogspot.in/ 11

Object File

A sequence of bytes organized into blocks

understandable by the system linker

Executable file

A series of code sections that can be brought into

memory executed by the loader

Page 12: Files concepts.53

http://raj-os.blogspot.in/ 12

Frequently Asked Questions

• 1. Define file• 2. Explain file management• 3. List the basic file operations• 4. Explain various file operations• 5.List and explain the common file types

Page 13: Files concepts.53

http://raj-os.blogspot.in/ 13

1. A file is a) A secondary storage device

b) One of CPU’s registers

c) A named collection of related information

d) None of the above

Page 14: Files concepts.53

http://raj-os.blogspot.in/ 14

2. A file can contain

a) Only numeric data

b) Only alphabetic data

c) Only graphical data

d) All of the above

Page 15: Files concepts.53

http://raj-os.blogspot.in/ 15

3. Information in a file is defined by

a) The operating system

b) Loader

c) Creator of file

d) None of the above

Page 16: Files concepts.53

http://raj-os.blogspot.in/ 16

4. File management refers to

a) Organization of files

b) Allocation of CPU to user programs

c) Allocation of main memory to user programs

d) None of the above

Page 17: Files concepts.53

http://raj-os.blogspot.in/ 17

5. Which of the following is not a file operation

a) Delete

b) Create

c) Read

d) None

Page 18: Files concepts.53

http://raj-os.blogspot.in/ 18

6 When a file is truncated

a) New contents are written into the file

b) The file is physically removed from the storage device

c) All file attributes remain unchanged except file length which is reset to zero

d) None of the above

Page 19: Files concepts.53

http://raj-os.blogspot.in/ 19

7. A file seek operation is also known as

a) Deleting a file

b) Reading a file

c) writing a file

d) Repositioning within a file

Page 20: Files concepts.53

http://raj-os.blogspot.in/ 20

8. Open file table is maintained by

a) The user

b) The compiler

c) The operating system

d) All of the above

Page 21: Files concepts.53

http://raj-os.blogspot.in/ 21

9. A file name usually contains

a) Three parts

b) Two parts

c) Five parts

d) Four parts

Page 22: Files concepts.53

http://raj-os.blogspot.in/ 22

10 . An object file is

a) A ready to run program file

b) A library of routines

c) A compiled but not linked machine language file

d) None of the above

Page 23: Files concepts.53

http://raj-os.blogspot.in/ 23

11. When you type a C program using an editor

a) An object file is generated

b) An executable file is created

c) A batch file is created

d) A source code file is created

Page 24: Files concepts.53

http://raj-os.blogspot.in/ 24

12. The length of file name extension is

a) 1 to 3 characters

b) 1 to 5 characters

c) 1 to 10

d) Unlimited

Page 25: Files concepts.53

Other subject materials

• Web designing

• Micro processors

• C++ tutorials

• java

home

25http://raj-os.blogspot.in/


Recommended