Presentation is loading. Please wait.

Presentation is loading. Please wait.

March 2005 1R. Smith - University of St Thomas - Minnesota Today’s Class Homework GradedHomework Graded Hard DrivesHard Drives File StructureFile Structure.

Similar presentations


Presentation on theme: "March 2005 1R. Smith - University of St Thomas - Minnesota Today’s Class Homework GradedHomework Graded Hard DrivesHard Drives File StructureFile Structure."— Presentation transcript:

1 March 2005 1R. Smith - University of St Thomas - Minnesota Today’s Class Homework GradedHomework Graded Hard DrivesHard Drives File StructureFile Structure File NamesFile Names Matlab ScriptsMatlab Scripts

2 Homework If you have questions – see me after classIf you have questions – see me after class Project PlansProject Plans –Scored maximum of 15 points –Ideal: should have required all sections explicitly identified When you are given a report format, you ignore it at your peril – a fundamental rule of any assignmentWhen you are given a report format, you ignore it at your peril – a fundamental rule of any assignment Better scores = more specific plansBetter scores = more specific plans Better scores = realistically thought out plansBetter scores = realistically thought out plans Assignments 11 and 12Assignments 11 and 12 –Looked for clean output – no debug printings –I ignored presence of extra search at the end (11) March 2005 2R. Smith - University of St Thomas - Minnesota

3 Hard Drives Based on magnetic recordingBased on magnetic recording –Motion of magnet = current (reading) –Current in a coil can magnetize (writing) Magnetic tape = same principleMagnetic tape = same principle –Drag the tape across a read/write head –Recording tape, VCRs Disks and Drums as storageDisks and Drums as storage –Read/write head hovers over the data Drum = stationary head, one per trackDrum = stationary head, one per track Disk = moving head -> what we use todayDisk = moving head -> what we use today Can PCs read and write Mac hard drives?Can PCs read and write Mac hard drives? –What about Linux hard drives? March 2005 3R. Smith - University of St Thomas - Minnesota

4 File Structure –Different structures in different operating systems NTFS – WindowsNTFS – Windows FAT – older Windows, still used for a ‘cheap’ file systemFAT – older Windows, still used for a ‘cheap’ file system HFS+ - MacintoshHFS+ - Macintosh Unix file systems – “UFS” and “ext” systemsUnix file systems – “UFS” and “ext” systems –How are they similar All have hierarchies of directories (folders)All have hierarchies of directories (folders) All have file ownership and permissions (except FAT)All have file ownership and permissions (except FAT) All support larger files (except FAT)All support larger files (except FAT) –How are they different “Path names” may use different delimiters \ : /“Path names” may use different delimiters \ : / “Internal” structure is different“Internal” structure is different –How they store files –How they handle free space on the hard drive March 2005 4R. Smith - University of St Thomas - Minnesota

5 Disk Formatting “Low level” formatting (“slow” formatting)“Low level” formatting (“slow” formatting) –Rebuilds the structure of the hard drive itself Structure: magnetic format used to arrange ‘raw’ dataStructure: magnetic format used to arrange ‘raw’ data –Low level reformatting can eliminate “bad sectors”can eliminate “bad sectors” makes it VERY HARD to recover data (EXPENSIVE)makes it VERY HARD to recover data (EXPENSIVE) VERY SLOWVERY SLOW “High level” formatting (“quick” formatting)“High level” formatting (“quick” formatting) –Rebuilds the file system by overwriting old directories –Gives you a newly emptied hard drive –You lose ALL of your old data It is hard, though possible to recover some of this dataIt is hard, though possible to recover some of this data Special software can sometimes recover the lost dataSpecial software can sometimes recover the lost data March 2005 5R. Smith - University of St Thomas - Minnesota

6 “Sanitizing” a hard drive The process of removing all the dataThe process of removing all the data Example: I’m returning a laptop to IRTExample: I’m returning a laptop to IRT –I used it to do taxes and home finance stuff –It had all sorts of personal (ID fraud sensitive) data Problem: even deleted data is recoverableProblem: even deleted data is recoverable –“Undelete” programs can often find deleted files Murphy’s Law: the programs can always recover stuff you want to lose forever, but never seem to recover stuff you deleted by accident and Really, Really need backMurphy’s Law: the programs can always recover stuff you want to lose forever, but never seem to recover stuff you deleted by accident and Really, Really need back Sanitization OptionsSanitization Options –“Wipe” the drive with multiple passes of writing data –Physically destroy the drive – harder than it sounds March 2005 6R. Smith - University of St Thomas - Minnesota

7 Working with file system hierarchy The problem: “include” files are in other placesThe problem: “include” files are in other places –Or, we’re looking for something in a web site What do we do?What do we do? –We provide a “path” to the folder containing the right file Most programs work from a “local” folderMost programs work from a “local” folder –Usually the folder containing other working files –Example: the folder with your “c” file when compiling That folder must also contain “inputs.h”That folder must also contain “inputs.h” –If we put a file elsewhere, we need to provide the “path” March 2005 7R. Smith - University of St Thomas - Minnesota

8 The “path” to a file Referring to other “local” foldersReferring to other “local” folders –Subfolders: put the folder name in front of the file name Multiple subfolders: include the ‘path’ from here to thereMultiple subfolders: include the ‘path’ from here to there –Folders “above” the local folder –Use “..” as name of the folder above this one. Each set of.. goes up a level in the folder hierarchyEach set of.. goes up a level in the folder hierarchy –A path can contain mixtures of “..” and subfolder names Referring to an absolute locationReferring to an absolute location –Include whole path from the drive letter or “root” March 2005 8R. Smith - University of St Thomas - Minnesota

9 March 2005 9R. Smith - University of St Thomas - Minnesota Back to Matlab: Scripts Just save a series of Matlab commands in a fileJust save a series of Matlab commands in a file Give it a.m suffixGive it a.m suffix Refer to it by name inside Matlab as a ‘command’Refer to it by name inside Matlab as a ‘command’ Use % as comment marker (like //)Use % as comment marker (like //) Use the built-in Matlab text editorUse the built-in Matlab text editor Functions are different – we’ll get to that laterFunctions are different – we’ll get to that later

10 March 2005 10R. Smith - University of St Thomas - Minnesota Import/Export of Matrices New population vectorNew population vector –Row 1 = #people in a house –Row 2-5 = four highest ages of people in a house Using Excel to type in a matrixUsing Excel to type in a matrix Using TextpadUsing Textpad Importing/ExportingImporting/Exporting –x = importdata(‘file.txt’); –x = csvread(‘file.csv’); –csvwrite(‘file2.csv’, x);

11 Writing a script to work with that file How does the script read in the file?How does the script read in the file? Where does the file reside?Where does the file reside? How do we calculate:How do we calculate: –Mean age of adults (over 21) –Mean age of children (under 18) March 2005 11R. Smith - University of St Thomas - Minnesota

12 March 2005 12R. Smith - University of St Thomas - Minnesota Creative Commons License This work is licensed under the Creative Commons Attribution-Share Alike 3.0 United States License. To view a copy of this license, visit http://creativecommons.org/licenses/by- sa/3.0/us/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.


Download ppt "March 2005 1R. Smith - University of St Thomas - Minnesota Today’s Class Homework GradedHomework Graded Hard DrivesHard Drives File StructureFile Structure."

Similar presentations


Ads by Google