Final Management Documents
Final Management Documents
IN
OPERATING SYSTEM
CEIT-03-501A
MEMBERS:
EIR, YARAH MAE B.
F
FLANDEZ, JHON JEREL
MANIMTIM, FRANCHES
PAJARON, LUSTER F.
PASCUAL, TRISHA MAE
ITAGA, JHON MICHAEL S.
R
FILE MANAGEMENT
The File Manager (also called the file management system) is the software responsible for
creating, deleting, modifying, and controlling access to files—as well as for managing the
resourcesusedbythefiles.TheFileManagerprovidessupportforlibrariesofprogramsanddata
to online users, for spooling operations, and for interactive computing. These functions are
performed in collaboration with the Device Manager.
The File Manager’s policy determines where each file is stored and how the system, and its
users, will be able to access them simply—via commands that are independent from device
details. In addition, the policy must determine who will haveaccesstowhatmaterial,andthis
involves two factors: flexibility ofaccesstotheinformationanditssubsequentprotection.The
File Manager does this by allowing access to shared files, providing distributed access, and
allowing users to browse through public directories. Meanwhile, the operating system must
protect its files against system malfunctions and provide security checks via account numbers
and passwords to preserve the integrity of the data and safeguard against tampering. These
protection techniques are explained later in this chapter.
Thecomputersystemallocatesafilebyactivatingtheappropriatesecondarystoragedeviceand
loading the file into memory while updating its records of who is using what file.
Finally, the File Manager deallocates a file byupdatingthefiletablesandrewritingthefile(if
revised) to the secondary storage device. Any processes waiting to access the file are then
notified of its availability.
DEFINITIONS :
● Acharacteristhesmallestelementinacomputerfileandreferstoaletter,thenumber
ofsymbolsthatcanbeentered,storedandoutputbyacomputer.Acharacterismadeup
of seven or eight bits depending on the character coding scheme used.
● A record is a group of related fields. A file is a group ofrelatedrecordsthatcontains
informationtobeusedbyspecificapplicationprogramstogeneratereports.Thistypeof
filecontainsdataandissometimescalledaflatfilebecauseithasnoconnectionstoother
files; unlike databases, it has no dimensionality.
● A database appears to the File Manager to be a type of file, but databases are more
complexbecausethey’reactuallygroupsofrelatedfilesthatareinterconnectedatvarious
levelstogiveusersflexibilityofaccesstothedatastored.Iftheuser’sdatabaserequiresa
specific structure, the File Manager must be able to support it.
● Program files contain instructions and data files contain data; but as far asstorageis
concerned, the File Manager treats them exactly the same way.
● Directoriesarespecialfileswithlistingsoffilenamesandtheirattributes.Datacollected
to monitor system performance and provide for system accounting is collected into files
Each storage unit, whether removable or integrated, is considered a "volume"thatcancontain
multiple files.Thesearereferredtoas"multifilevolumes".Somefilesareextremelylargeand
span multiple volumes, in which case they are called "multivolume files.
Each volume in the system is given a unique name. The operating system stores identifying
information about the volume on an easily accessible location, such astheinnermostpartofa
CD/DVD, the beginning of a tape, or the first sector of the outermost track of a disk pack.
Each volume in the system is given a name. The File Manager writes this name and other
descriptive information, as shown in Figure 8.3, on an easy-to-access place on each unit: the
innermostpartoftheCDorDVD,thebeginningofthetape,orthefirstsectoroftheoutermost
track of the disk pack.
The volume descriptor, which is stored at the beginning of each volume, includes this vital
information about the storage unit.
TheMasterFileDirectory(MFD)wasanessentialdatastructureonanyITSfilesystem,soany
efforttopreservetherestofthedatashouldincludethisstructuretoo.TheMFDissimilartothe
modern-daỳ`rootdirectory''inahierarchicalfilesystem,exceptthatITShadaflatfilesystem
with only one level of directories. So, the MFD contained a listing ofallofthedirectorieson
disk. Each user had his/her own directory and each directory had a unique index number
associatedwithit.Theauthorofafilewasrecordedastheindexnumbertohisdirectoryinthe
MFD.Inessence,theonlyinformationtheMFDprovidesusistheuserIDnumbertousername
mapping required to determine whose files are whose.
Decoding the MFD is simple as long as one understandssomeoftheconventionsusedinITS
data structures.Itwasourhopethatbytranslatingthisinarationalmanner,Iwouldbethelast
person required to understand the format of the MFD.
The MFD is basically an array of usernames encoded in ̀`sixbit''; the index number is
determinedbythepositionofthenameinthearray.Sixbitisamethodofencodingcharactersin
36-bit words in which each character is 6bitslong,foratotalof6charactersperword.Sixbit
does not include the lower-case characters, so all user nameswereincapitalletters.Eachuser
name was limited to 6 characters, so it would fit in one 36-bit word.Thetranslationfromthe
array of sixbit user names to an array of ASCII usernames was straightforward.
Introducing Subdirectories
What are subdirectories?
● directory contained in another directory, called a parent directory. A parent directory
Regardless of the complexity of the directory structure, each file entry in every directory
contains information describing the file. They help organize files and other directories in a
hierarchical structure, allowing users to group related content effectively.Forexample,amain
directory called "Documents" could have subdirectories like "Reports," "Invoices," and
"Projects" to manage different types of documents neatly.
Benefits of Subdirectories:
● Users can organize files logically (e.g., grouping project files).
● File naming conflicts are reduced since each directory has unique filenames
File-Naming Conventions
Afilenamingconventionisaframeworkfornamingyourfilesinawaythatdescribeswhatthey
containandhowtheyrelatetootherfiles.Filenamingconventionshelpyoustayorganizedand
quickly identify your files. In a shared or collaborative group file-sharing setting, it will help
othersmoreeasilynavigateyourwork.Itisessentialtoestablishaconventionbeforeyoubegin
collecting files or data in order to prevent a backlog or unorganized content that will lead to
misplaced or lost data.
Filenamingconventionsplayacrucialroleinensuringefficientorganizationandmanagementof
files.Byusingaconsistentandstandardizedapproachtonaming,individualsandorganizations
can streamline their file systems, enhance retrieval processes, and minimize the potential for
errorsandconfusion.Inthisarticle,wewillexploretheimportanceoffilenamingconventions,
discuss common conventions, share best practices, and provide examples of effective naming
strategies.
When you're working, you may not always think about how you name your files. You may end
up with a folder that looks like this:
● 20160104_ProjectA_Ex1Test1_SmithE_v1.xlsx
● 20160104_ProjectA_MeetingNotes_SmithE_v2.docx
● ExperimentName_InstrumentName_CaptureTime_ImageID.tif
Windows:
C
● omplete: `C:\IMFST\FLYNN\INVENTORY_COST.DOC`
● Organized using drive letters and backslashes.
UNIX/Linux:
C
● omplete: `/usr/imfst/flynn/inventory_cost.doc`
● Organized using forward slashes, case-sensitive names often in lowercase.
T
● he File Manager sets a “home” directory when a session starts.
● U sers work within a current directory, so only relative filenames are needed.
● This simplifies access while relying on the underlying tree structure to locate files.
What happens if an extension is incorrect or unknown? Most ask for guidance from the user, as
shown in Figure 8.5.
FILE ORGANIZATION
File organization is the arrangement of records within a file since all files are composed of
records.Whenausergivesacommandtomodifythecontentsofafile,it’sactuallyacommand
to access records within the file.
ByRecordFormatallfilesarecomposedofrecords.Whenausergivesacommandtomodify
thecontentsofafile,it’sactuallyacommandtoaccessrecordswithinthefile.Withineachfile,
the records are all presumed to have the same format: they can be of their fixed length or of
variablelength,asshowninFigure8.6.Andtheserecords,regardlessofformat,canbeblocked
or not blocked.
Variable-lengthrecordsdon’tleaveemptystoragespaceanddon’ttruncateanycharacters,thus
eliminatingthetwodisadvantagesoffixed-lengthrecords.Butwhiletheycaneasilyberead(one
aftertheother),they’redifficulttoaccessdirectlybecauseit’shardtocalculateexactlywherethe
recordislocated.That’swhythey’reusedmostfrequentlyinfilesthatarelikelytobeaccessed
sequentially,suchastextfilesandprogramfilesorfilesthatuseanindextoaccesstheirrecords.
The record format, how it’s blocked, and other related information is kept in the file descriptor.
PHYSICAL FILE ORGANIZATION
The physical organization of a file has to do with the way records are arranged and the
characteristics of the medium used to store it.
On magnetic disks (hard drives), files can be organized in one of several ways: sequential, direct,
or indexed sequential. To select the best of these file organizations, the programmer or analyst
usually considers these practical characteristics:
● Volatility of the data—the frequency with which additions and deletions are made.
● Activity of the file—the percentage of records processed during a given run.
● Size of the file.
● Response time—the amount of time the user is willing to wait before the requested
operation is completed (This is especially crucial when doing time-sensitive searches)
Sequential record organization is by far the easiest to implement because recordsarestored
and retrieved serially, oneaftertheother.Tofindaspecificrecord,thefileissearchedfromits
beginning until the requested record is found.
Tospeedtheprocess,someoptimizationfeaturesmaybebuiltintothesystem.Oneistoselecta
keyfieldfromtherecordandthensorttherecordsbythatfieldbeforestoringthem.Later,when
auserrequestsaspecificrecord,thesystemsearchesonlythekeyfieldofeachrecordinthefile.
Thesearchisendedwheneitheranexactmatchisfoundorthekeyfieldfortherequestedrecord
is smaller than the value of the record last compared, in which case the message “record not
found” is sent to the user and the search is terminated.
Although this technique aids the search process, it complicates file maintenance because the
original order must be preserved every time records are added or deleted.Andtopreservethe
physicalorder,thefilemustbecompletelyrewrittenormaintainedinasortedfashioneverytime
it’s updated.
A direct record organization uses direct access files, which, of course, can be implemented
only on direct access storage devices (discussed in Chapter 7). These files give users the
flexibility of accessing any record in any order without having to begin a search from the
beginningofthefiletodoso.It’salsoknownas“randomorganization,”anditsfilesarecalled
“random access files.”
Recordsareidentifiedbytheirrelativeaddresses—theiraddressesrelativetothebeginningofthe
file.Theselogicaladdressesarecomputedwhentherecordsarestoredandthenagainwhenthe
records are retrieved.
Themethodusedisquitestraightforward.Theuseridentifiesafield(orcombinationoffields)in
the record format and designates it as the key field because it uniquelyidentifieseachrecord.
Theprogramusedtostorethedatafollowsasetofinstructions,calledahashingalgorithm,that
transforms each key into a number: the record’s logical address. This is given to the File
Manager,whichtakesthenecessarystepstotranslatethelogicaladdressintoaphysicaladdress
(cylinder, surface, and record number) preserving the file organization.
Indexedsequentialrecordorganizationcombines thebestofsequentialanddirectaccess.
It’s created and maintainedthroughanIndexedSequentialAccessMethod(ISAM)application,
whichremovestheburdenofhandlingoverflowsandpreservesrecordorderfromtheshoulders
oftheprogrammer.Thistypeoforganizationdoesn’tcreatecollisionsbecauseitdoesn’tusethe
resultofthehashingalgorithmtogeneratearecord’saddress.Instead,itusesthisinformationto
generate an index file through which the records are retrieved. This organization divides an
orderedsequentialfileintoblocksofequalsize.TheirsizeisdeterminedbytheFileManagerto
takeadvantageofphysicalstoragedevicesandtooptimizeretrievalstrategies.Eachentryinthe
indexfilecontainsthehighestrecordkeyandthephysicallocationofthedatablockwherethis
record, and the records with smaller keys, are stored.
Contiguous Storage
Itisamethodofstoringdatarecordsinasingle,continuousblockofspaceonadisk.Meaning
that the records are placed one after another.
Noncontiguous storage allows data to be stored in any available space on a disk, without
requiring it to be in one continuous block. Each record or block of data is linkedtothenext
using pointers, creating a logical sequence called an extent. This approach is flexible and
efficientinusingavailablespace,asitdoesn'trequirealarge,contiguousblockoffreememory.
However,accessingrecordscanbeslowerthanincontiguousstorage,asthesystemmustfollow
pointers to locate the data. Noncontiguous storage is commonly used in file systems and
databases to manage dynamic data and minimize fragmentation issues.
Indexed Storage
Indexed storage is a method of organizing data on a disk that uses an index block to store
pointers to every sector of a file.
Whenafileiscreated,thepointersintheindexblockareallsettonull.Then,aseachsectoris
filled,thepointerissettotheappropriatesectoraddress—tobeprecise,theaddressisremoved
from the empty spacelistandcopiedintoitspositionintheindexblock.Thisschemesupports
both sequential and direct access, but it doesn’t necessarily improve the use of storage space
becauseeachfilemusthaveanindexblock—usuallythesizeofonedisksector.Forlargerfiles
with more entries, several levels of indexes can be generated; in which case,tofindadesired
record, the File Manager accesses the first index (the highest level), which points to asecond
index (lower level), which points to an even lower-level index and eventually to the data record.