Week 13 - File Management
Week 13 - File Management
File Management
1
File Management System
2
File Management System
A file management system is a type of software that
manages data files in a computer system. It has limited
capabilities and is designed to manage individual or group
files, such as special office documents and records. It may
display report details, like owner, creation date, state of
completion and similar features useful in an office
environment.
A file management system is also known as a file manager.
3
Rules for Filenames
Like devices, disk files have to identified so we can address
them. These filenames have specific rules.
The basic form of a filename is:
Filename.ext
The following are legal and illegal characters in a filename:
Legal: A-Z 0-9 $#&@!()-{}'`_~
Illegal: |<>\^+=?/[]";,* plus control characters and the
space
Some other operating systems allow longer file names and
there are commercial utilities which link a database of long
names to your short names so you can find files by using
more fully descriptive names.
4
MS-DOS
DOS commands are issued at the prompt C:\>.
Whatever you type after that prompt that is not in the
COMMAND.COM standard library is assumed to be the
name of a file on the default disk and DOS will search for it.
If you type C\:> FILENAME
DOS will look for: FILENAME.COM or FILENAME.EXE or
FILENAME.BAT
The first is a command file (note the COM extension). The
second is an execution file (EXE extension). And, the third
is a batch file (a series of DOS commands in a text file)
5
MS-DOS
KNL2373 KHP/NR 6
Simple Commands
CLS Clears the screen and puts the cursor in the home
(upper left) position.
FORMAT d: /s /u where
d: defines the disk that will be formatted
/s puts the DOS system on disk to make it bootable
/u specifies an unconditional format (cannot unformat
the disk)
COPY d1:FILENAME1.ext d2:filename2.ext/v
DEL d:FILENAME.ext
7
Subdirectories
8
File Allocation Table (FAT)
A patented file system developed by Microsoft .
The FAT file system is considered relatively uncomplicated,
and is consequently supported by virtually all existing
operating systems for personal computers.
The most common implementations have a serious
drawback in that when files are deleted and new files
written to the media, their fragments tend to become
scattered over the entire media making reading and
writing a slow process. Defragmentation is one solution
to this, but is often a lengthy process in itself and has to be
repeated regularly to keep the FAT file system clean.
9
File Management System
Provides a logical view for
the user and hides the
physical implementation
Command shell takes user
file commands and
program file requests and
translates them for the file
manager
Requests data transfers
from I/O device drivers
File security and
protection of file integrity
10
File Operations
File as a whole Within a file Record Storage
Copy, Move Open a file
Retrieve a
Read a number
List, Print of bytes from record (read)
Load and file Store a record
execute a Write a (write)
program number of
Load file into bytes to a file Add a record to
memory Move the file a file
pointer
Store file from forward or Delete a record
memory backward Modify contents
Append data Move file of a record
from memory to pointer to
file beginning of a
Compile, file
assemble a file Close a file
11
File Access Methods
Sequential Access
File is read in sequence from beginning to end
Majority of all files
Program source and binary files
Random Access
Assumes file is made up of fixed length logical records
Hashing is a common method used to calculate the location of an
internal logical record
Indexed Access
Additional means for accessing and viewing records in a file
Key indexes
ISAM – indexed sequential access method
12
Physical File Storage
Contiguous (adjacent/adjoining)
Non-contiguous
Linked
Indexed
Examples
DOS/Windows FAT
UNIX i-nodes
Windows NTFS
13
Contiguous Storage Allocation
Assign blocks (all in a row)
to hold the file
Access is simple for both
sequential and random
methods
Allocation strategies to
minimize fragmentation
First-fit, best-fit
Eventually disk becomes
fragmented
14
Contiguous Storage Allocation
Disadvantages
Space must be large enough
Have to take into account
file growth
May need to be moved if it
outgrows its space
Fragmentation of disk
15
Non-Contiguous Storage
Allocation (Linked)
Non-contiguous
Each block contains a link
to the next physical block
Variant – links in both
directions
Advantages:
no fragmentation
Adding to a file is easy
16
Non-Contiguous Storage
Allocation (Linked)
Disadvantages:
Not usable for random
access
Additional disk head
searching
Overhead in storing the
pointers
Recovery of a defective
block is difficult
17
Non-Contiguous Storage
Allocation (Indexed)
All link pointers are stored
together in a single block
called the index block
One index block per file
Advantages
No fragmentation
Can be used for random
access
18
Non-Contiguous Storage
Allocation (Indexed)
Disadvantage
Slower due to additional
access of the index block
Additional disk head
searching
Recovery of a defective
block is difficult
19
Windows FAT
Linked allocation with links
stored in a table
Table contains the first
block of each file on the
disk or disk partition
Successive blocks contain a
link to the next block
20
Windows FAT
Disadvantages
Requires a tremendous
amount of space
File integrity can be easily
compromised
21
MS DOS FAT
Linked Allocation
and File Allocation
Table
KNL2373 KHP/NR 22
MS DOS FAT
23
Unix i-nodes
Advantages
Fast for small blocks
Can accommodate very large files – 100’s of gigabytes
24
Windows NTFS
Volumes may be a
fraction of a disk or
span many disks
First 16 records are
metadata files
which describe the
volume
File records made
up of attributes,
including file
information and
data
KNL2373 KHP/NR 25
Free Space Management
Bit map method
one bit for each block
to indicate if it is used or free
26
File Transfer Protocol (FTP)
Part of TCP/IP protocol family
File Transfer Protocol (FTP) is a standard network protocol
used to transfer computer files between a client and
server on a computer network.
27
TELNET
Telnet is an application layer protocol used on the Internet
or local area networks to provide a bidirectional
interactive text-oriented communication facility using a
virtual terminal connection.
28
Domain Name System (DNS)
Domain name system (DNS) is a hierarchical naming
system built on a distributed database. This system
transforms domain names to IP addresses and makes it
possible to assign domain names to groups of Internet
resources and users, regardless of the entities' physical
location
KNL2373 KHP/NR 29
Uniform Resource Locator (URL)
A uniform resource locator (URL) is the address of a
resource on the Internet. A URL indicates the location of
a resource as well as the protocol used to access it.
30
Other (Remote Access)
31
Other (File Manager)
KNL2373 KHP/NR 32
Other (File Manager)
KNL2373 KHP/NR 33
Other (File Manager)
KNL2373 KHP/NR 34
Other (File Manager)
35
Thank You
36