Program Files Data Files and Subdirectories Ch 4
Program Files, Data Files, and Subdirectories Ch 4 1
Overview The cooperative effort between the operating system and the application program and its data files will be discussed. Ch 4 2
Overview Shareware and freeware will be compared and contrasted. Ch 4 3
Overview Will learn to differentiate between a program file and a data file. Ch 4 4
Overview The hierarchical filing system of a tree-structured directory will be explained. Ch 4 5
Overview Will identify and use subdirectory commands to help manage files from the command prompt. Ch 4 6
Why Use the Command Prompt Screen? Review commands learned: èFORMAT èDISKCOPY èDIR èCLS Ch 4 7
Why Use the Command Prompt Window? Four major categories of application programs: èWord processors èSpreadsheets èDatabases èGraphics Ch 4 8
Why Use the Command Prompt Window? OS is important: èManages the system. èEnables the user to manage and manipulate files on disks Ch 4 9
Why Use the Command Prompt Window? The OS manages the files not the information put into files. Ch 4 10
Program Files, Data Files, and the OS è WUGXP Subdirectory contains: èGames which contains èBOG 2 which contains èApplication program called BOG Ch 4 11
Program Files, Data Files, and the OS Legacy software can be used by Windows OS because of downward compatibility. Ch 4 12
Program Files, Data Files, and the OS MS-DOS commands work in conjunction with various types of files. Ch 4 13
Program Files, Data Files, and the OS Real mode operation: è Used for software written for DOS and early versions of Windows è Application program interfaces with device or DOS and DOS does the work Ch 4 14
Program Files, Data Files, and the OS Protected mode operation: èUsed for Windows software èApplication software does NOT interface with hardware èDrivers talk to virtual device drivers Ch 4 15
Program Files, Data Files, and the OS Operating system: è Loads application program into memory è Assists in loading data file into memory è Ensures cooperation between application program and its data files Ch 4 16
Program Files, Data Files, and the OS Commands: èAre programs èAllow user to interface with OS to manage programs and data files Ch 4 17
Shareware Freeware & shareware programs available from a wide variety of sources. Ch 4 18
Shareware Freeware: èSoftware that is in the public domain Ch 4 19
Shareware: èTrial version of a program Ch 4 20
Shareware Register shareware program to receive: èFull version with documentation èUpdate notices èTechnical support Ch 4 21
Shareware Appendix A lists all shareware programs with fees and addresses necessary to register them. Ch 4 22
Activity—Using DIR to locate the BOG Program KEY CONCEPTS: è Use DIR command to verify BOG is on hard disk è Function of. exe and. dat Ch 4 23
Using Application Programs & Data Files è DIR command acknowledges files exist. è To use file, must load it into memory. Ch 4 24
Using Application Programs & Data Files è BOG. EXE is the application program. è BOG. DAT is the data file. Ch 4 25
Activity—Using Application Programs and Data Files KEY CONCEPTS: è Only programs can be executed èFunction of file extension èBOG. DAT is the data file Ch 4 26
Managing Program and Data Files at the Command Prompt Organize programs and files into subdirectories so it will be easier to save and locate them. Ch 4 27
Hierarchical Filing Systems or Tree-Structured Directory Root directory: è Created when disk is formatted è Represented by () - the backslash è Acts as an index to disk Ch 4 28
Hierarchical Filing Systems or Tree-Structured Directory Table 4. 1 FAT 16 Root Directory File Limits p. 135 Ch 4 29
Hierarchical Filing Systems or Tree-Structured Directory è FAT 16 åRoot directory - fixed size & location on disk è FAT 32 åRoot directory free to grow as necessary è NTFS åNo limit to # of files/directories in root directory Ch 4 30
Hierarchical Filing Systems or Tree-Structured Directory Subdirectories: èImportant part of organizing disk èCan contain subdirectories èNo limit in number of files Ch 4 31
Hierarchical Filing Systems or Tree-Structured Directory Subdirectory structure: èLooks like inverted family tree èRoot directory åAt top of tree åPoint of entry in hierarchical structure Ch 4 32
Hierarchical Filing Systems or Tree-Structured Directory Fig 4. 1 A Directory Is Like a Family Tree p. 135 Ch 4 33
Hierarchical Filing Systems or Tree-Structured Directory Fig 4. 2 Hierarchical Structure of a Directory p. 136 Ch 4 34
Hierarchical Filing Systems or Tree-Structured Directory Fig 4. 3 A disk as a Building p. 136 Ch 4 35
Hierarchical Filing Systems or Tree-Structured Directory Fig 4. 4 Subdirectories as Rooms p. 137 Ch 4 36
Hierarchical Filing Systems or Tree-Structured Directory Fig 4. 5 More Subdirectories p. 137 Ch 4 37
Hierarchical Filing Systems or Tree-Structured Directory Fig 4. 6 Files in Subdirectories p. 138 Ch 4 38
Hierarchical Filing Systems or Tree-Structured Directory General comments: è Only one root directory - point of entry è Directories åHave only one parent directory åCan have any # of child directories Ch 4 39
Hierarchical Filing Systems or Tree-Structured Directory General comments: è Each subdirectory åDependent upon structure above it åKnows only its parents and children è Not changing size of structure - merely organizing it Ch 4 40
Hierarchical Filing Systems or Tree-Structured Directory General Comments: è User names the subdirectories not the root directory è Subdirectories åFollow file naming rules åHave special commands Ch 4 41
Hierarchical Filing Systems or Tree-Structured Directory Table 4. 2 Directory Management Commands p. 139 Ch 4 42
Creating Subdirectories è Format disk - preparing it to hold files. è Set up subdirectory - preparing it to hold logical group of files. Ch 4 43
Creating Subdirectories Subdirectory command syntax: MKDIR [drive: ] path or MD [drive: ] path Ch 4 44
Activity—How to Create Subdirectories KEY CONCEPTS: è USED /Q parameter to format disk and used shortcut to place volume label on disk è Determine when at root directory è Verify subdirectory created è Attributes (D, H, S, R, A, -) è Use DIR to display directory contents è Subdirectory has two named subdirectories åDot and double dot Ch 4 45
The Current Directory Operating system keeps track of: èDefault drive èCurrent (default) directory for each disk Ch 4 46
The Current Directory CD command: èDisplays current default directory: åCD with no parameters èChanges default directory: åParameter after CD CD [drive: ][path] Ch 4 47
The Current Directory èCD command does not use spaces as delimiters. èSyntax åCD [/D] [drive: ] [path] Ch 4 48
The Current Directory What happens if prompt is A: > and you key in: èCD C: WUGXP èC: èCD /D C: WUGXP Ch 4 49
Activity—Using the CD Command KEY CONCEPTS: è Results of keying in CD åWith no parameters åFollowed by subdirectory name è CD alone cannot be used to change drives è Results of keying in DIR Ch 4 50
Relative and Absolute Paths Use MD or MKDIR command to make new subdirectories. MD [drive: ] path Ch 4 51
Relative and Absolute Paths Fig 4. 7 Directory with Subdirectories p. 147 Ch 4 52
Relative and Absolute Paths Absolute path: èDirect route from root directory to the subdirectory of interest èIs always absolutely correct èComplete and total hierarchical structure Ch 4 53
Relative and Absolute Paths Relative path: èRoute from where you are to where you want to go èCan move to directory above it and beneath it Ch 4 54
Relative and Absolute Paths èDirectory: å Knows about files/directories within itself å Knows about its immediate child directory and parent directory è To move to another parent directory must return to the root Ch 4 55
Relative and Absolute Paths The root directory is parent or common “ancestor” of all directories. Ch 4 56
Activity—Creating More Subdirectories KEY CONCEPTS: èAbsolute vs. relative path èHierarchy èFile vs. directory èCreate subdirectories èWhen and when not to use Ch 4 57
Knowing the Default Directory It is important to know default drive and directory. Ch 4 58
Knowing the Default Directory è PROMPT command without parameters displays current drive and > sign. è CD command displays default or current drive and directory. Ch 4 59
PROMPT Command è If no prompt specified prompt includes path and >. è Changing way prompt is displayed does not change its function. Ch 4 60
PROMPT Command PROMPT command: èContained in CMD. EXE èSyntax - PROMPT [text] èCan include metastrings Ch 4 61
PROMPT Command PROMPT command Metastrings p. 153 Ch 4 62
PROMPT Command Metastrings p. 153 Ch 4 63
Activity—Changing the Prompt KEY CONCEPTS: è Changing appearance of prompt does not change its function è Important to display default drive letter è Can return prompt to default value by keying in command with no parameters Ch 4 64
Subdirectory Markers è Single. (one period) - specific name of current directory. è Double. . (two periods) - specific name of parent directory of current subdirectory. Ch 4 65
Subdirectory Markers èCan use. . (two periods) to move up the directory. èCannot use shortcut symbol to move down hierarchy. Ch 4 66
Activity—Using Subdirectory Markers KEY CONCEPTS: èUsing. . (two periods) èSpace after CD/MD command & before backslash or directory marker is optional èWhen to use relative path èWhen to use absolute path èKeying in CD. . vs. keying in CD Ch 4 67
Activity—Using Subdirectory Markers KEY CONCEPTS: èWhat happens if MD GOLF keyed in instead of MD PHYSEDGOLF èResults of keying in CD or CD Ch 4 68
Activity—Using Subdirectory Markers Fig 4. 8 Structure of the Data Disk p. 158 Ch 4 69
Activity—Using Subdirectory Markers Fig 4. 9 Subdirectories: Another View p. 159 Ch 4 70
Changing the Names of Directories MOVE command: è Used to rename directory from the MS-DOS prompt èMOVE [/Y | /-Y] [drive: ] [path] ådirname 1 direname 2 Ch 4 71
Activity—Using MOVE to Rename a Directory KEY CONCEPT: è Give correct path name (absolute or relative) and can rename a directory from any location Ch 4 72
Removing Directories RD or RMDIR command: èUsed to remove directories èCannot remove åDirectory containing hidden or system files åDirectory you are in åDefault subdirectory åRoot directory èCannot use with wildcards Ch 4 73
Removing Directories RD [/S] /Q] [drive: ] path Without parameters: è Removes: åOnly empty subdirectories åFiles one at a time - bottom up Ch 4 74
Removing Directories RD [/S] /Q] [drive: ] path With parameters: è Can remove directory tree è Can remove directory with hidden or system files è Can traverse directory tree from top down Ch 4 75
Activity—Using the RD Command KEY CONCEPTS: èDirectory is type of file èCannot delete åDirectory you are in åDefault directory åRoot directory Ch 4 76
Activity—Using the RD Command KEY CONCEPTS: èCreate directories - top down èRD without parameters åRemove directories - bottom up åRemoves empty directories Ch 4 77
Deleting a Directory and Its Subdirectories RD [/S] [/Q] [drive: ] path RD with /S parameter: èDeletes directory and contents (subdirectories/files) with one command èRemoves a tree Ch 4 78
Deleting a Directory and Its Subdirectories RD with /S parameter: è Traverse directory tree from top down è With /Q parameter - RD runs in quiet mode è Useful, fast, powerful, dangerous Ch 4 79
Activity—Using RD with the /S Parameter KEY CONCEPTS: èRD /S å Removes files and subdirectories with one command å Useful, fast, powerful, dangerous Ch 4 80
Using Multiple Parameters with MD and RD Can create (MD) or remove (RD) more than one directory on the same command line. Ch 4 81
Using Multiple Parameters with MD and RD MD command: èCreate parent and child directory with one command. èIf parent directory does not exist, the OS will create child directories and any necessary intermediate directories. Ch 4 82
Activity—Using Multiple Parameters with MD & RD KEY CONCEPTS: èCreating subdirectories with MD èRemoving subdirectories with RD èUsing /S and /Q parameters with RD Ch 4 83
Understanding the PATH Command Covered in this chapter: è CD command è Located/executed BOG è Reviewed process of executing a program å. com, . exe, and. bat extensions denote executable programs è Used MD, DIR, CD, RD PROMPT, FORMAT, DISKCOPY, and MOVE Ch 4 84
Understanding the PATH Command OS Search for Correct File is Limited to File Extensions in Order Listed p. 168 Ch 4 85
Understanding the PATH Command PATH command: è Locates/executes executable program files è Searches å Memory å Current directory å Subdirectories specified with PATH command Ch 4 86
Understanding the PATH Command PATH command syntax: PATH [[drive: ] path [; …] [%PATH%]] Ch 4 87
Activity—Using the Path Command KEY CONCEPTS: èUse of ; following PATH command èLocation of BOG èElements of path separated by (; ) èNo need to replace existing PATH to change it èReturning PATH to original setting Ch 4 88
- Slides: 88