File System Exercise: Creating Directory Structure in HtDP Intermediate-Level
50 likes | 132 Views
Create a file system exercise by defining file and directory structures in HtDP Intermediate-Level language. Learn to use constructors and accessors for files and directories. Implement functions to count files, calculate disk usage, and search for files in the directory tree.
File System Exercise: Creating Directory Structure in HtDP Intermediate-Level
E N D
Presentation Transcript
Dr-Scheme Related Primitives • Data definition • (define-struct file (name size content)) • (define-struct dir (name dirs files)) • Corresponding constructors and accessorsthat are automatically generated • make-file, file-name, file-size, file-content • make-dir, dir-name, dir-dirs, dir-files • Note, define-struct is not available in standard Scheme (R5RS). So, choose the language level as HtPD Intermediate-level or Advanced.
Additional Issues • You do not need to use teach packs (e.g., dir.ss) for this assignment because you are not required to navigate your Windows/UNIX directories. • Use secure shell ssh to log into unixapps1 and sftp to copy files into unixapps1 before executing turnin command.
Function Definitions • Represent figure as EG44 • Define how-many : Number of files • Define du-dir : Disk usage (size) • Submit version in which directory requires 1 unit of storage • Define find? : Determines if a file occurs in the directory tree CS680 Only • Define find : Determines list of file paths if there are multiple occurrences of a file in the directory tree