0% found this document useful (0 votes)
11 views15 pages

Final Management Documents

The document discusses file management in operating systems, detailing the responsibilities and functions of the File Manager, which includes creating, deleting, modifying, and controlling access to files. It outlines how the File Manager interacts with users and manages file storage, including tracking, allocating, and deallocating files, as well as defining access policies. Additionally, it provides definitions of key terms related to file management, such as characters, fields, records, and directories.

Uploaded by

mchlvyrox
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views15 pages

Final Management Documents

The document discusses file management in operating systems, detailing the responsibilities and functions of the File Manager, which includes creating, deleting, modifying, and controlling access to files. It outlines how the File Manager interacts with users and manages file storage, including tracking, allocating, and deallocating files, as well as defining access policies. Additionally, it provides definitions of key terms related to file management, such as characters, fields, records, and directories.

Uploaded by

mchlvyrox
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

‭FILE MANAGEMENT‬

‭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‬
‭resources‬‭used‬‭by‬‭the‬‭files.‬‭The‬‭File‬‭Manager‬‭provides‬‭support‬‭for‬‭libraries‬‭of‬‭programs‬‭and‬‭data‬
‭to‬ ‭online‬ ‭users,‬ ‭for‬ ‭spooling‬ ‭operations,‬ ‭and‬ ‭for‬ ‭interactive‬ ‭computing.‬ ‭These‬ ‭functions‬ ‭are‬
‭performed in collaboration with the Device Manager.‬

‭Responsibilities of the File Manager‬


‭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‬‭managing‬‭the‬‭resources‬
‭used‬ ‭by‬ ‭the‬ ‭files.‬ ‭It‬ ‭provides‬ ‭support‬ ‭for‬ ‭libraries‬ ‭of‬ ‭programs‬ ‭and‬ ‭data‬ ‭to‬ ‭online‬ ‭users,‬ ‭for‬
‭spooling‬ ‭operations,‬ ‭and‬ ‭for‬ ‭interactive‬ ‭computing.‬ ‭These‬ ‭functions‬ ‭are‬ ‭performed‬ ‭in‬
‭collaboration with the Device Manager.‬

‭The File Manager has several important tasks:‬


‭1. Tracking Files:‬‭It keeps a record of where each file is stored on the computer.‬
‭2. Establishing Policies:‬‭It sets rules for how files should be stored and accessed, ensuring that‬
‭storage space is used efficiently.‬
‭3. Allocating Files:‬‭When a user wants to access a file, the File Manager grants permission and‬
‭keeps track of who is using it.‬
‭4. Deallocating Files:‬‭Once a file is no longer needed, the File Manager updates its records and‬
‭makes the file available for others to use.‬

‭How to interact with a file manager?‬


‭These‬ ‭commands‬ ‭and‬ ‭many‬ ‭more‬‭were‬‭designed‬‭to‬‭be‬‭very‬‭simple‬‭to‬‭use,‬‭so‬‭they’re‬‭devoid‬‭of‬
‭the‬ ‭detailed‬ ‭instructions‬ ‭required‬ ‭to‬‭run‬‭the‬‭device‬‭(information‬‭in‬‭the‬‭device‬‭driver)‬‭where‬‭the‬
‭file may be stored. That is, they’re device independent.‬
‭1. Move the read/write heads to the cylinder or track where the record is to be found.‬
‭2. Wait for the rotational delay until the sector containing the desired record‬
‭passes under the read/write head.‬
‭3. Activate the appropriate read/write head and read the record.‬
‭4. Transfer the record to main memory.‬
‭5. Set a flag to indicate that the device is free to satisfy another request.‬

‭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‬ ‭have‬‭access‬‭to‬‭what‬‭material,‬‭and‬‭this‬
‭involves‬ ‭two‬ ‭factors:‬ ‭flexibility‬ ‭of‬‭access‬‭to‬‭the‬‭information‬‭and‬‭its‬‭subsequent‬‭protection.‬‭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.‬

‭The‬‭computer‬‭system‬‭allocates‬‭a‬‭file‬‭by‬‭activating‬‭the‬‭appropriate‬‭secondary‬‭storage‬‭device‬‭and‬
‭loading the file into memory while updating its records of who is using what file.‬
‭Finally,‬ ‭the‬ ‭File‬ ‭Manager‬ ‭deallocates‬ ‭a‬ ‭file‬ ‭by‬‭updating‬‭the‬‭file‬‭tables‬‭and‬‭rewriting‬‭the‬‭file‬‭(if‬
‭revised)‬ ‭to‬ ‭the‬ ‭secondary‬ ‭storage‬ ‭device.‬ ‭Any‬ ‭processes‬ ‭waiting‬ ‭to‬ ‭access‬ ‭the‬ ‭file‬ ‭are‬ ‭then‬
‭notified of its availability.‬

‭DEFINITIONS :‬

‭●‬ ‭A‬‭character‬‭is‬‭the‬‭smallest‬‭element‬‭in‬‭a‬‭computer‬‭file‬‭and‬‭refers‬‭to‬‭a‬‭letter,‬‭the‬‭number‬
‭of‬‭symbols‬‭that‬‭can‬‭be‬‭entered,‬‭stored‬‭and‬‭output‬‭by‬‭a‬‭computer.‬‭A‬‭character‬‭is‬‭made‬‭up‬
‭of seven or eight bits depending on the character coding scheme used.‬

‭●‬ ‭A‬ ‭field‬ ‭is‬ ‭a‬ ‭group‬ ‭of‬ ‭related‬ ‭bytes‬‭that‬‭can‬‭be‬‭identified‬‭by‬‭the‬‭user‬‭with‬‭a‬‭name,‬‭type,‬


‭and size.‬

‭●‬ ‭A‬ ‭record‬ ‭is‬ ‭a‬ ‭group‬ ‭of‬ ‭related‬ ‭fields.‬ ‭A‬ ‭file‬ ‭is‬ ‭a‬ ‭group‬ ‭of‬‭related‬‭records‬‭that‬‭contains‬
‭information‬‭to‬‭be‬‭used‬‭by‬‭specific‬‭application‬‭programs‬‭to‬‭generate‬‭reports.‬‭This‬‭type‬‭of‬
‭file‬‭contains‬‭data‬‭and‬‭is‬‭sometimes‬‭called‬‭a‬‭flat‬‭file‬‭because‬‭it‬‭has‬‭no‬‭connections‬‭to‬‭other‬
‭files; unlike databases, it has no dimensionality.‬

‭●‬ ‭A‬ ‭database‬ ‭appears‬ ‭to‬ ‭the‬ ‭File‬ ‭Manager‬ ‭to‬ ‭be‬ ‭a‬ ‭type‬ ‭of‬ ‭file,‬ ‭but‬ ‭databases‬ ‭are‬ ‭more‬
‭complex‬‭because‬‭they’re‬‭actually‬‭groups‬‭of‬‭related‬‭files‬‭that‬‭are‬‭interconnected‬‭at‬‭various‬
‭levels‬‭to‬‭give‬‭users‬‭flexibility‬‭of‬‭access‬‭to‬‭the‬‭data‬‭stored.‬‭If‬‭the‬‭user’s‬‭database‬‭requires‬‭a‬
‭specific structure, the File Manager must be able to support it.‬

‭●‬ ‭Program‬ ‭files‬ ‭contain‬ ‭instructions‬ ‭and‬ ‭data‬ ‭files‬ ‭contain‬ ‭data;‬ ‭but‬ ‭as‬ ‭far‬ ‭as‬‭storage‬‭is‬
‭concerned, the File Manager treats them exactly the same way.‬

‭●‬ ‭Directories‬‭are‬‭special‬‭files‬‭with‬‭listings‬‭of‬‭filenames‬‭and‬‭their‬‭attributes.‬‭Data‬‭collected‬
‭to monitor system performance and provide for system accounting is collected into files‬

‭Typical Volume Configuration‬


‭The‬ ‭role‬ ‭of‬ ‭each‬ ‭volume‬ ‭and‬ ‭its‬ ‭peer‬ ‭volumes‬ ‭must‬ ‭be‬ ‭defined‬ ‭in‬ ‭the‬‭storage‬‭system‬‭to‬‭allow‬
‭functioning‬ ‭within‬ ‭the‬ ‭remote‬ ‭mirroring‬ ‭process.‬ ‭Computers‬ ‭typically‬ ‭store‬ ‭active‬ ‭files‬ ‭on‬
‭secondary‬‭storage‬‭units‬‭like‬‭hard‬‭drives,‬‭while‬‭less‬‭frequently‬‭used‬‭files‬‭are‬‭stored‬‭on‬‭removable‬
‭media like CDs, DVDs, floppy disks, USB devices, and other removable storage.‬

‭Each‬ ‭storage‬ ‭unit,‬ ‭whether‬ ‭removable‬ ‭or‬ ‭integrated,‬ ‭is‬ ‭considered‬ ‭a‬ ‭"volume"‬‭that‬‭can‬‭contain‬
‭multiple‬ ‭files.‬‭These‬‭are‬‭referred‬‭to‬‭as‬‭"multi‬‭file‬‭volumes".‬‭Some‬‭files‬‭are‬‭extremely‬‭large‬‭and‬
‭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‬ ‭as‬‭the‬‭innermost‬‭part‬‭of‬‭a‬
‭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‬
‭innermost‬‭part‬‭of‬‭the‬‭CD‬‭or‬‭DVD,‬‭the‬‭beginning‬‭of‬‭the‬‭tape,‬‭or‬‭the‬‭first‬‭sector‬‭of‬‭the‬‭outermost‬
‭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.‬

‭The‬‭Master‬‭File‬‭Directory‬‭(MFD)‬‭was‬‭an‬‭essential‬‭data‬‭structure‬‭on‬‭any‬‭ITS‬‭file‬‭system,‬‭so‬‭any‬
‭effort‬‭to‬‭preserve‬‭the‬‭rest‬‭of‬‭the‬‭data‬‭should‬‭include‬‭this‬‭structure‬‭too.‬‭The‬‭MFD‬‭is‬‭similar‬‭to‬‭the‬
‭modern-day‬‭̀`root‬‭directory''‬‭in‬‭a‬‭hierarchical‬‭file‬‭system,‬‭except‬‭that‬‭ITS‬‭had‬‭a‬‭flat‬‭file‬‭system‬
‭with‬ ‭only‬ ‭one‬ ‭level‬ ‭of‬ ‭directories.‬ ‭So,‬ ‭the‬ ‭MFD‬ ‭contained‬ ‭a‬ ‭listing‬ ‭of‬‭all‬‭of‬‭the‬‭directories‬‭on‬
‭disk.‬ ‭Each‬ ‭user‬ ‭had‬ ‭his/her‬ ‭own‬ ‭directory‬ ‭and‬ ‭each‬ ‭directory‬ ‭had‬ ‭a‬ ‭unique‬ ‭index‬ ‭number‬
‭associated‬‭with‬‭it.‬‭The‬‭author‬‭of‬‭a‬‭file‬‭was‬‭recorded‬‭as‬‭the‬‭index‬‭number‬‭to‬‭his‬‭directory‬‭in‬‭the‬
‭MFD.‬‭In‬‭essence,‬‭the‬‭only‬‭information‬‭the‬‭MFD‬‭provides‬‭us‬‭is‬‭the‬‭user‬‭ID‬‭number‬‭to‬‭user‬‭name‬
‭mapping required to determine whose files are whose.‬
‭Decoding‬ ‭the‬ ‭MFD‬ ‭is‬ ‭simple‬ ‭as‬ ‭long‬ ‭as‬ ‭one‬ ‭understands‬‭some‬‭of‬‭the‬‭conventions‬‭used‬‭in‬‭ITS‬
‭data‬ ‭structures.‬‭It‬‭was‬‭our‬‭hope‬‭that‬‭by‬‭translating‬‭this‬‭in‬‭a‬‭rational‬‭manner,‬‭I‬‭would‬‭be‬‭the‬‭last‬
‭person required to understand the format of the MFD.‬

‭The‬ ‭MFD‬ ‭is‬ ‭basically‬ ‭an‬ ‭array‬ ‭of‬ ‭usernames‬ ‭encoded‬ ‭in‬ ‭̀`sixbit'';‬ ‭the‬ ‭index‬ ‭number‬ ‭is‬
‭determined‬‭by‬‭the‬‭position‬‭of‬‭the‬‭name‬‭in‬‭the‬‭array.‬‭Sixbit‬‭is‬‭a‬‭method‬‭of‬‭encoding‬‭characters‬‭in‬
‭36-bit‬ ‭words‬ ‭in‬ ‭which‬ ‭each‬ ‭character‬ ‭is‬ ‭6‬‭bits‬‭long,‬‭for‬‭a‬‭total‬‭of‬‭6‬‭characters‬‭per‬‭word.‬‭Sixbit‬
‭does‬ ‭not‬ ‭include‬ ‭the‬ ‭lower-case‬ ‭characters,‬ ‭so‬ ‭all‬ ‭user‬ ‭names‬‭were‬‭in‬‭capital‬‭letters.‬‭Each‬‭user‬
‭name‬ ‭was‬ ‭limited‬ ‭to‬ ‭6‬ ‭characters,‬ ‭so‬ ‭it‬ ‭would‬ ‭fit‬ ‭in‬ ‭one‬ ‭36-bit‬ ‭word.‬‭The‬‭translation‬‭from‬‭the‬
‭array of sixbit user names to an array of ASCII usernames was straightforward.‬

‭If‬ ‭the‬ ‭MFD‬ ‭was‬‭included‬‭on‬‭a‬‭backup‬‭tape,‬‭it‬‭was‬‭always‬‭the‬‭first‬‭file.‬‭Therefore,‬‭the‬‭archivist‬


‭software‬ ‭looks‬ ‭for‬ ‭the‬ ‭presence‬ ‭of‬ ‭the‬ ‭MFD‬ ‭and‬ ‭then‬‭decodes‬‭it‬‭as‬‭mentioned‬‭above.‬‭The‬‭raw‬
‭and‬‭translated‬‭forms‬‭of‬‭the‬‭MFD‬‭are‬‭then‬‭written‬‭out‬‭in‬‭TCFS‬‭format‬‭as‬‭with‬‭the‬‭rest‬‭of‬‭the‬‭files.‬
‭However,‬ ‭the‬ ‭archivist‬ ‭also‬ ‭keeps‬ ‭a‬ ‭copy‬ ‭of‬ ‭the‬ ‭MFD‬ ‭in‬ ‭memory‬ ‭so‬ ‭it‬‭can‬‭determine‬‭the‬‭user‬
‭name associated with any files it finds later on the tape.‬

‭What‬ ‭happens‬ ‭to‬ ‭the‬ ‭rest‬ ‭of‬‭the‬‭storage?‬‭The‬‭remainder‬‭of‬‭the‬‭volume‬‭is‬‭used‬‭to‬‭actually‬‭store‬


‭the files listed in the MFD.‬

‭Introducing Subdirectories‬
‭What are subdirectories?‬

‭●‬ ‭directory‬ ‭contained‬ ‭in‬ ‭another‬ ‭directory,‬ ‭called‬ ‭a‬ ‭parent‬ ‭directory‬‭.‬ ‭A‬ ‭parent‬ ‭directory‬

‭may have multiple subdirectories.‬


‭●‬ ‭a‬ ‭subdirectory‬ ‭organizes‬ ‭and‬ ‭manages‬ ‭files‬ ‭by‬ ‭grouping‬ ‭them‬ ‭within‬ ‭a‬ ‭hierarchy‬ ‭of‬
‭directories.‬ ‭Operating‬ ‭systems‬ ‭use‬ ‭a‬ ‭directory‬ ‭structure‬ ‭to‬ ‭organize‬ ‭files‬ ‭on‬ ‭storage‬
‭devices like hard drives,‬‭SSDs‬‭, or USB drives.‬
‭●‬ ‭Subdirectories are like folders that group related files for better organization.-‬
‭●‬ ‭Created when a user opens an account.‬
‭●‬ ‭Treated as files in the MFD but flagged to indicate they contain other files.‬

‭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.‬‭For‬‭example,‬‭a‬‭main‬
‭directory‬ ‭called‬ ‭"Documents"‬ ‭could‬ ‭have‬ ‭subdirectories‬ ‭like‬ ‭"Reports,"‬ ‭"Invoices,"‬ ‭and‬
‭"Projects" to manage different types of documents neatly.‬

‭How They Work:‬


‭●‬ ‭File Manager starts at the MFD, which stores entries for files and subdirectories.‬
‭●‬ ‭It looks for the user’s directory, then searches subdirectories to find the requested file.‬
‭●‬ ‭Modern systems use a tree structure for directories, making it easier to manage files.‬

‭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 Entry (File Descriptor)‬


‭Each file or subdirectory entry includes:‬
‭●‬ ‭Filename: Must be unique in its directory (may be case-sensitive).‬
‭●‬ ‭File type: Indicates purpose (e.g., file or directory).-‬
‭●‬ ‭File size: Stored for quick reference.‬
‭●‬ ‭File location: Shows where the file is physically stored.‬
‭●‬ ‭Date & time: When the file was created.‬
‭●‬ ‭Owner: Who the file belongs to.‬
‭●‬ ‭Protection: Access restrictions (who can view or modify it).‬
‭●‬ ‭Record size: Fixed or maximum size of the dat‬
‭Tree structures allow the system to efficiently search individual directories because‬
‭there are fewer entries in each directory. However, the path to the requested file may‬
‭lead through several directories. For every file request, the MFD is the point of entry.‬
‭Actually, the MFD is usually transparent to the user—it’s accessible only by the operating‬
‭system. When the user wants to access a specific file, the filename is sent to the‬
‭File Manager. The File Manager first searches the MFD for the user’s directory, and it‬
‭then searches the user’s directory and any subdirectories for the requested file and its‬
‭Location.‬

‭File-Naming Conventions‬
‭A‬‭file‬‭naming‬‭convention‬‭is‬‭a‬‭framework‬‭for‬‭naming‬‭your‬‭files‬‭in‬‭a‬‭way‬‭that‬‭describes‬‭what‬‭they‬
‭contain‬‭and‬‭how‬‭they‬‭relate‬‭to‬‭other‬‭files.‬‭File‬‭naming‬‭conventions‬‭help‬‭you‬‭stay‬‭organized‬‭and‬
‭quickly‬ ‭identify‬ ‭your‬ ‭files.‬ ‭In‬ ‭a‬ ‭shared‬ ‭or‬ ‭collaborative‬ ‭group‬ ‭file-sharing‬ ‭setting,‬ ‭it‬ ‭will‬ ‭help‬
‭others‬‭more‬‭easily‬‭navigate‬‭your‬‭work.‬‭It‬‭is‬‭essential‬‭to‬‭establish‬‭a‬‭convention‬‭before‬‭you‬‭begin‬
‭collecting‬ ‭files‬ ‭or‬ ‭data‬ ‭in‬ ‭order‬ ‭to‬ ‭prevent‬ ‭a‬ ‭backlog‬ ‭or‬ ‭unorganized‬ ‭content‬ ‭that‬ ‭will‬ ‭lead‬ ‭to‬
‭misplaced or lost data.‬

‭File‬‭naming‬‭conventions‬‭play‬‭a‬‭crucial‬‭role‬‭in‬‭ensuring‬‭efficient‬‭organization‬‭and‬‭management‬‭of‬
‭files.‬‭By‬‭using‬‭a‬‭consistent‬‭and‬‭standardized‬‭approach‬‭to‬‭naming,‬‭individuals‬‭and‬‭organizations‬
‭can‬ ‭streamline‬ ‭their‬ ‭file‬ ‭systems,‬ ‭enhance‬ ‭retrieval‬ ‭processes,‬ ‭and‬ ‭minimize‬ ‭the‬ ‭potential‬ ‭for‬
‭errors‬‭and‬‭confusion.‬‭In‬‭this‬‭article,‬‭we‬‭will‬‭explore‬‭the‬‭importance‬‭of‬‭file‬‭naming‬‭conventions,‬
‭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:‬

‭Example of File Names‬

‭No naming convention:‬


‭●‬ ‭Test data 2016.xlsx‬
‭●‬ ‭Meeting notes Jan 17.doc‬
‭●‬ ‭Notes Eric.txt‬
‭●‬ ‭Final FINAL last version.docx‬

‭With a naming convention:‬

‭●‬ ‭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.‬

‭WhyDon’t Users See Complete File Names?‬

‭‬ 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.‬‭When‬‭a‬‭user‬‭gives‬‭a‬‭command‬‭to‬‭modify‬‭the‬‭contents‬‭of‬‭a‬‭file,‬‭it’s‬‭actually‬‭a‬‭command‬
‭to access records within the file.‬

‭By‬‭Record‬‭Format‬‭all‬‭files‬‭are‬‭composed‬‭of‬‭records.‬‭When‬‭a‬‭user‬‭gives‬‭a‬‭command‬‭to‬‭modify‬
‭the‬‭contents‬‭of‬‭a‬‭file,‬‭it’s‬‭actually‬‭a‬‭command‬‭to‬‭access‬‭records‬‭within‬‭the‬‭file.‬‭Within‬‭each‬‭file,‬
‭the‬ ‭records‬ ‭are‬ ‭all‬ ‭presumed‬ ‭to‬ ‭have‬ ‭the‬ ‭same‬ ‭format:‬ ‭they‬ ‭can‬ ‭be‬ ‭of‬ ‭their‬ ‭fixed‬ ‭length‬ ‭or‬ ‭of‬
‭variable‬‭length,‬‭as‬‭shown‬‭in‬‭Figure‬‭8.6.‬‭And‬‭these‬‭records,‬‭regardless‬‭of‬‭format,‬‭can‬‭be‬‭blocked‬
‭or not blocked.‬

‭Types of Record Formats‬


‭Fixed-length‬‭records‬‭are‬‭the‬‭most‬‭common‬‭because‬‭they’re‬‭the‬‭easiest‬‭to‬‭access‬‭directly.‬‭That’s‬
‭why‬ ‭they’re‬ ‭ideal‬ ‭for‬ ‭data‬ ‭files.‬ ‭The‬ ‭critical‬ ‭aspect‬ ‭of‬ ‭fixed-length‬ ‭records‬ ‭is‬ ‭the‬ ‭size‬ ‭of‬ ‭the‬
‭record.‬ ‭If‬ ‭it’s‬ ‭too‬ ‭small—smaller‬ ‭than‬ ‭the‬‭number‬‭of‬‭characters‬‭to‬‭be‬‭stored‬‭in‬‭the‬‭record—the‬
‭leftover‬ ‭characters‬ ‭are‬ ‭truncated.‬‭But‬‭if‬‭the‬‭record‬‭size‬‭is‬‭too‬‭large—‬‭larger‬‭than‬‭the‬‭number‬‭of‬
‭characters to be stored—storage space is wasted.‬

‭Variable-length‬‭records‬‭don’t‬‭leave‬‭empty‬‭storage‬‭space‬‭and‬‭don’t‬‭truncate‬‭any‬‭characters,‬‭thus‬
‭eliminating‬‭the‬‭two‬‭disadvantages‬‭of‬‭fixed-length‬‭records.‬‭But‬‭while‬‭they‬‭can‬‭easily‬‭be‬‭read‬‭(one‬
‭after‬‭the‬‭other),‬‭they’re‬‭difficult‬‭to‬‭access‬‭directly‬‭because‬‭it’s‬‭hard‬‭to‬‭calculate‬‭exactly‬‭where‬‭the‬
‭record‬‭is‬‭located.‬‭That’s‬‭why‬‭they’re‬‭used‬‭most‬‭frequently‬‭in‬‭files‬‭that‬‭are‬‭likely‬‭to‬‭be‬‭accessed‬
‭sequentially,‬‭such‬‭as‬‭text‬‭files‬‭and‬‭program‬‭files‬‭or‬‭files‬‭that‬‭use‬‭an‬‭index‬‭to‬‭access‬‭their‬‭records.‬
‭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‬ ‭records‬‭are‬‭stored‬
‭and‬ ‭retrieved‬ ‭serially,‬ ‭one‬‭after‬‭the‬‭other.‬‭To‬‭find‬‭a‬‭specific‬‭record,‬‭the‬‭file‬‭is‬‭searched‬‭from‬‭its‬
‭beginning until the requested record is found.‬
‭To‬‭speed‬‭the‬‭process,‬‭some‬‭optimization‬‭features‬‭may‬‭be‬‭built‬‭into‬‭the‬‭system.‬‭One‬‭is‬‭to‬‭select‬‭a‬
‭key‬‭field‬‭from‬‭the‬‭record‬‭and‬‭then‬‭sort‬‭the‬‭records‬‭by‬‭that‬‭field‬‭before‬‭storing‬‭them.‬‭Later,‬‭when‬
‭a‬‭user‬‭requests‬‭a‬‭specific‬‭record,‬‭the‬‭system‬‭searches‬‭only‬‭the‬‭key‬‭field‬‭of‬‭each‬‭record‬‭in‬‭the‬‭file.‬
‭The‬‭search‬‭is‬‭ended‬‭when‬‭either‬‭an‬‭exact‬‭match‬‭is‬‭found‬‭or‬‭the‬‭key‬‭field‬‭for‬‭the‬‭requested‬‭record‬
‭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.‬‭And‬‭to‬‭preserve‬‭the‬
‭physical‬‭order,‬‭the‬‭file‬‭must‬‭be‬‭completely‬‭rewritten‬‭or‬‭maintained‬‭in‬‭a‬‭sorted‬‭fashion‬‭every‬‭time‬
‭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‬
‭beginning‬‭of‬‭the‬‭file‬‭to‬‭do‬‭so.‬‭It’s‬‭also‬‭known‬‭as‬‭“random‬‭organization,”‬‭and‬‭its‬‭files‬‭are‬‭called‬
‭“random access files.”‬

‭Records‬‭are‬‭identified‬‭by‬‭their‬‭relative‬‭addresses—their‬‭addresses‬‭relative‬‭to‬‭the‬‭beginning‬‭of‬‭the‬
‭file.‬‭These‬‭logical‬‭addresses‬‭are‬‭computed‬‭when‬‭the‬‭records‬‭are‬‭stored‬‭and‬‭then‬‭again‬‭when‬‭the‬
‭records are retrieved.‬

‭The‬‭method‬‭used‬‭is‬‭quite‬‭straightforward.‬‭The‬‭user‬‭identifies‬‭a‬‭field‬‭(or‬‭combination‬‭of‬‭fields)‬‭in‬
‭the‬ ‭record‬ ‭format‬ ‭and‬ ‭designates‬ ‭it‬ ‭as‬ ‭the‬ ‭key‬ ‭field‬ ‭because‬ ‭it‬ ‭uniquely‬‭identifies‬‭each‬‭record.‬
‭The‬‭program‬‭used‬‭to‬‭store‬‭the‬‭data‬‭follows‬‭a‬‭set‬‭of‬‭instructions,‬‭called‬‭a‬‭hashing‬‭algorithm,‬‭that‬
‭transforms‬ ‭each‬ ‭key‬ ‭into‬ ‭a‬ ‭number:‬ ‭the‬ ‭record’s‬ ‭logical‬ ‭address.‬ ‭This‬ ‭is‬ ‭given‬ ‭to‬ ‭the‬ ‭File‬
‭Manager,‬‭which‬‭takes‬‭the‬‭necessary‬‭steps‬‭to‬‭translate‬‭the‬‭logical‬‭address‬‭into‬‭a‬‭physical‬‭address‬
‭(cylinder, surface, and record number) preserving the file organization.‬

‭Indexed‬‭sequential‬‭record‬‭organization‬‭combines‬ ‭the‬‭best‬‭of‬‭sequential‬‭and‬‭direct‬‭access.‬
‭It’s‬ ‭created‬ ‭and‬ ‭maintained‬‭through‬‭an‬‭Indexed‬‭Sequential‬‭Access‬‭Method‬‭(ISAM)‬‭application,‬
‭which‬‭removes‬‭the‬‭burden‬‭of‬‭handling‬‭overflows‬‭and‬‭preserves‬‭record‬‭order‬‭from‬‭the‬‭shoulders‬
‭of‬‭the‬‭programmer.‬‭This‬‭type‬‭of‬‭organization‬‭doesn’t‬‭create‬‭collisions‬‭because‬‭it‬‭doesn’t‬‭use‬‭the‬
‭result‬‭of‬‭the‬‭hashing‬‭algorithm‬‭to‬‭generate‬‭a‬‭record’s‬‭address.‬‭Instead,‬‭it‬‭uses‬‭this‬‭information‬‭to‬
‭generate‬ ‭an‬ ‭index‬ ‭file‬ ‭through‬ ‭which‬ ‭the‬ ‭records‬ ‭are‬ ‭retrieved.‬ ‭This‬ ‭organization‬ ‭divides‬ ‭an‬
‭ordered‬‭sequential‬‭file‬‭into‬‭blocks‬‭of‬‭equal‬‭size.‬‭Their‬‭size‬‭is‬‭determined‬‭by‬‭the‬‭File‬‭Manager‬‭to‬
‭take‬‭advantage‬‭of‬‭physical‬‭storage‬‭devices‬‭and‬‭to‬‭optimize‬‭retrieval‬‭strategies.‬‭Each‬‭entry‬‭in‬‭the‬
‭index‬‭file‬‭contains‬‭the‬‭highest‬‭record‬‭key‬‭and‬‭the‬‭physical‬‭location‬‭of‬‭the‬‭data‬‭block‬‭where‬‭this‬
‭record, and the records with smaller keys, are stored.‬

‭PHYSICAL STORAGE ALLOCATION‬

‭Physical‬ ‭Storage‬ ‭allocation‬ ‭determines‬ ‭how‬‭data‬‭records‬‭are‬‭organized‬‭and‬‭managed‬‭on‬‭a‬‭disk.‬


‭These‬ ‭records‬‭can‬‭vary‬‭in‬‭length‬‭but‬‭must‬‭follow‬‭a‬‭standard‬‭format.‬‭While‬‭applications‬‭usually‬
‭handle record structure, database heavy stems often require specialized management.‬
‭The‬ ‭File‬ ‭Manager‬ ‭must‬ ‭work‬ ‭with‬ ‭files‬ ‭not‬ ‭just‬ ‭as‬ ‭whole‬ ‭units‬ ‭but‬ ‭also‬ ‭as‬ ‭logical‬ ‭units‬ ‭or‬
‭records.‬‭Records‬‭within‬‭a‬‭file‬‭must‬‭have‬‭the‬‭same‬‭format,‬‭but‬‭they‬‭can‬‭vary‬‭in‬‭length,‬‭as‬‭shown‬
‭in the example below.‬

‭Contiguous Storage‬
‭It‬‭is‬‭a‬‭method‬‭of‬‭storing‬‭data‬‭records‬‭in‬‭a‬‭single,‬‭continuous‬‭block‬‭of‬‭space‬‭on‬‭a‬‭disk.‬‭Meaning‬
‭that the records are placed one after another.‬

‭The‬ ‭File‬ ‭Manager,‬ ‭the‬ ‭software‬ ‭responsible‬ ‭for‬‭managing‬‭files‬‭on‬‭a‬‭disk,‬‭keeps‬‭track‬‭of‬‭empty‬


‭spaces‬ ‭by‬ ‭treating‬ ‭them‬ ‭as‬ ‭special‬ ‭"files".‬ ‭These‬ ‭"files"‬ ‭are‬‭listed‬‭in‬‭the‬‭directory,‬‭but‬‭they‬‭are‬
‭flagged‬ ‭to‬ ‭distinguish‬ ‭them‬ ‭from‬ ‭actual‬ ‭files‬ ‭containing‬ ‭data.‬ ‭This‬ ‭allows‬ ‭the‬ ‭File‬‭Manager‬‭to‬
‭easily identify and allocate these empty spaces when new files need to be stored.‬
‭Noncontiguous‬ ‭storage‬ ‭allocation‬ ‭,‬ ‭also‬ ‭known‬ ‭as‬ ‭linked‬‭allocation,‬‭allows‬‭data‬‭records‬‭to‬‭be‬
‭stored‬‭in‬‭any‬‭available‬‭space‬‭on‬‭the‬‭disk,‬‭not‬‭necessarily‬‭in‬‭a‬‭continuous‬‭block.‬‭Instead‬‭of‬‭being‬
‭stored together, these records are linked together using pointers, forming what’s called an extent.‬

‭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‬ ‭linked‬‭to‬‭the‬‭next‬
‭using‬ ‭pointers,‬ ‭creating‬ ‭a‬ ‭logical‬ ‭sequence‬ ‭called‬ ‭an‬ ‭extent.‬ ‭This‬ ‭approach‬ ‭is‬ ‭flexible‬ ‭and‬
‭efficient‬‭in‬‭using‬‭available‬‭space,‬‭as‬‭it‬‭doesn't‬‭require‬‭a‬‭large,‬‭contiguous‬‭block‬‭of‬‭free‬‭memory.‬
‭However,‬‭accessing‬‭records‬‭can‬‭be‬‭slower‬‭than‬‭in‬‭contiguous‬‭storage,‬‭as‬‭the‬‭system‬‭must‬‭follow‬
‭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.‬
‭When‬‭a‬‭file‬‭is‬‭created,‬‭the‬‭pointers‬‭in‬‭the‬‭index‬‭block‬‭are‬‭all‬‭set‬‭to‬‭null.‬‭Then,‬‭as‬‭each‬‭sector‬‭is‬
‭filled,‬‭the‬‭pointer‬‭is‬‭set‬‭to‬‭the‬‭appropriate‬‭sector‬‭address—to‬‭be‬‭precise,‬‭the‬‭address‬‭is‬‭removed‬
‭from‬ ‭the‬ ‭empty‬ ‭space‬‭list‬‭and‬‭copied‬‭into‬‭its‬‭position‬‭in‬‭the‬‭index‬‭block.‬‭This‬‭scheme‬‭supports‬
‭both‬ ‭sequential‬ ‭and‬ ‭direct‬ ‭access,‬ ‭but‬ ‭it‬ ‭doesn’t‬ ‭necessarily‬ ‭improve‬ ‭the‬ ‭use‬ ‭of‬ ‭storage‬ ‭space‬
‭because‬‭each‬‭file‬‭must‬‭have‬‭an‬‭index‬‭block—usually‬‭the‬‭size‬‭of‬‭one‬‭disk‬‭sector.‬‭For‬‭larger‬‭files‬
‭with‬ ‭more‬ ‭entries,‬ ‭several‬ ‭levels‬ ‭of‬ ‭indexes‬ ‭can‬ ‭be‬ ‭generated;‬ ‭in‬ ‭which‬ ‭case,‬‭to‬‭find‬‭a‬‭desired‬
‭record,‬ ‭the‬ ‭File‬ ‭Manager‬ ‭accesses‬ ‭the‬ ‭first‬ ‭index‬ ‭(the‬ ‭highest‬ ‭level),‬ ‭which‬ ‭points‬ ‭to‬ ‭a‬‭second‬
‭index (lower level), which points to an even lower-level index and eventually to the data record.‬

You might also like