chapter 12 - file management Flashcards

1
Q

3 desirable properties of files

A

Long-term existence: kept on secondary storage
Sharable between processes: for shared access
Structure: some file systems manage the internal structure of a file, which can be organized in a way suitable for particular applications

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what are the 6 file operations?

A

create, delete, open, close, read, write

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is the file structure?

A

field, record, file, database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what is a field? (file structure)

A

basic element of data, characterized by its length and data type, contains single value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is a record? (file structure)

A

collection of related fields
ex. employee record
can be variable length

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what is a file? (file structure)

A

collection of similar records, treated as single entity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what is a database? (file structure)

A

collection of related file(s)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what are Unix files?

A

streams of bytes, don’t have internal structure as far as OS is concerned

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what is a file management system?

A

set of system software providing file services to users and applications

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

7 objectives for a file management system?

A

Meet the data management needs and requirements of the user

Guarantee that the data in the file are valid.

Optimize performance.

Provide I/O support for a variety of storage device types.

Minimize or eliminate the potential for lost or destroyed data.

Provide a standardized set of I/O interface routines

Provide I/O support for multiple users.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what is involved in a file system architecture?

A

Device driver: communicates directly with hardware device.

Basic file system: handles physical I/O.

Basic I/O supervisor: responsible for file I/O initiation and termination, device selection, I/O scheduling, buffer allocation.

Logical I/O: Enables users and applications to access records. Provides record-oriented I/O capability.

Access method: access files based on their structure and method of access.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

what are the 5 file management functions?

A

identify and locate a selected file

enforce user access control (shared system)

employ access method on the records

provide blocking for file I/O

manage secondary storage

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

5 criteria for choosing a file organization?

A

Rapid Access
Ease of update
Economy of storage
Simple maintenance
Reliability

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

5 fundamental file organizations?

A

Pile
Sequential file
Indexed sequential file
Indexed file
Direct or hashed file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what is a pile? (fundamental file org)

A

data collected in the order it arrives
Purpose is to accumulate a mass of data and save it
Records may have different structures or no structure.
Data access is by exhaustive search
May be useful to store data prior to processing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

what is sequential file? (fundamental file org)

A

Fixed format used for records.
Records are the same length.
All fields the same (order and length).
Field names and lengths are attributes of the file.
One field is the key field
- Uniquely identifies the record
- Records are stored in key sequence
New records are placed in a log file or transaction file.
Log file is periodically merged with the master file.
Useful in batch processing.

17
Q

what is an indexed sequential file? (fundamental file org)

A

File is like a sequential file with key and data.
Index provides a lookup capability to quickly reach the vicinity of the desired record.
Greatly reduces the time required to access a single record, while still providing sequential processing.
Additions can be handled by an overflow file, which can be periodically merged with the main file.

18
Q

what is an indexed file? (fundamental file org)

A

Uses multiple indexes for different key fields.
Abandons sequential format with single key.
Records are accessed only by their index.
Records can be variable length.
Exhaustive index has pointers to every record.
Partial index only has pointers to records having the field of interest.
Useful in applications such as an airline reservation system that need to access particular records quickly, but rarely need to process them sequentially.

19
Q

what is a direct/hash file? (fundamental file org)

A

Turn key value into an address to support direct access of records in the file.
Gives very rapid access to data.
Useful if records are only accessed one at a time.

20
Q

what is a B-tree?

A

indexes often implemented as this.

has large branching factor leading to tree of low height -> results in fewer disk accesses to traverse the tree in a search

21
Q

what is a directory?

A

contains info about file (attributes, location, ownership)

is a file itself, owned by OS, managed by file system

22
Q

2 issues that arise from file sharing

A

access rights and simultaneous access

23
Q

2 approaches for simultaneous access

A
  1. lock entire file when it needs to be updated
  2. lock individual record during update
24
Q

when does record blocking occur? when does unblocking occur?

A

when writing data to file

when reading data in file

25
Q

what are the 3 blocking methods (record blocking)

A

Fixed: fixed-length records. May cause internal fragmentation.

Variable-length spanned: variable-length records which may span blocks. Permits unlimited record size. May require multiple I/O’s.

Variable-length unspanned: variable-length records which do not span blocks. May cause internal fragmentation.

26
Q

2 management issues in secondary storage management

A

allocating blocks to files and maintaining a list of free blocks

27
Q

what are the 2 methods of allocation portion size in a file

A

Large, variable-length contiguous portion.
Good performance.
May cause fragmentation.
Allocation table is simple, just need pointer to beginning and length.

Small fixed-sized blocks.
Good flexibility.
Requires more complicated allocation table to keep track of non-contiguous blocks.

28
Q

3 file allocation methods

A

contiguous, chained, indexed

29
Q

contiguous allocation

A

a single contiguous set of blocks is allocated to a file at the time of file creation.

is a preallocation method of a variable-size portion.

May require periodic compaction due to fragmentation.

Good for sequential file access.

30
Q

chained allocation

A

allocate individual blocks

each block contains a pointer to the next block

31
Q

indexed allocation

A

an index specifies the location of each block

32
Q

what does a disk allocation table do

A

keeps track of available space

33
Q

what are the 4 techniques for free space management

A

Bit tables: each bit represents a block
Chained free portions: free portions are chained together.
Indexing: index keeps track of every free portion as if it was a file.
Free block list: blocks are numbered and list of free block numbers is maintained.