================ Start Lecture #16
================
Review midterm answers
Hand out lab2
4.1.2: File structure
A file is a
- Byte stream
- Unix, dos, windows (I think)
- Max flexibility
- Min structure
- (fixed size) Record stream: Out of date
- Varied and complicated beast
- Indexed sequential
- B-trees
- Supports rapidly finding a record with a specific
key
- Supports retrieving (varying size) records in key order.
- Treated in depth in database courses
4.1.3: File types
Examples
- (Regular) files
- Directories: studied below
- Special files (for devices)
- Uses the naming power of files to unify many actions
- dir # prints on screen
- dir > file # result put in a file
- dir > /dev/tape # results written to tape
- ``Symbolic'' Links (similar to ``shortcuts''): Also studied
below.
``Magic number'': Identifies an executable file.
- There can be
several different magic numbers for different types of
executables.
- unix: #!/usr/bin/perl
Strongly typed files: Easy (hopefully normal) case easier (and
safer) hard case harder.
4.1.4: File access
Basically two possibilities, sequential access and random access
(a.k.a. direct access). Previously, files were declared to be
sequential or random. Modern systems do not do this.
- Sequential access where the bytes (or records)
are accessed in order (i.e., n-1, n, n+1, ...) is most common and
gives the highest performance. For some devices (e.g. tapes) access
``must'' be sequential.
- In random access, the bytes are accessed in any
order. Thus each access must specify which bytes are desired.
4.1.5: File attributes
A laundry list of properties that can be specified for a file,
e.g.