1 / 5

Directory-File System Exercise

Directory-File System Exercise. Figure 44 in HtDP. Racket Primitives. Data definition (define- struct file (name size content)) (define- struct dir (name dirs files)) Corresponding constructors and accessors that are automatically generated

chung
Download Presentation

Directory-File System Exercise

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Directory-File System Exercise

  2. Figure 44 in HtDP

  3. Racket 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 Legacy Languages => (Scheme) R5RS. So, choose the language level as Teaching Languages=>HtPD => Intermediate-level or Advanced.

  4. Additional Issues • Do not need teach packs (e.g., dir.ss) for this assignment because navigating through real Windows/UNIX directories not required. • Use secure shell ssh to log into unixapps1 and sftp to copy files into unixapps1 before executing (one of the following) turnincommand. /common/public/tkprasad/cs480/turnin-pa1  fileSys.scm /common/public/tkprasad/cs480/turnin-pa1  fileSys.rkt

  5. Function Definitions • Represent figure as EG44 • Define how-many : Number of files • Define du-dir : Disk usage (size) • Submit the version in which both the directory and the file require 1 unit of storage for holding their meta-information, and additionally, each file requires storage to hold its content, whose size has been explicitly specified. • 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

More Related