Figure 44 in HtDP DrScheme Related Primitives Data definition define struct file name size content define struct dir name dirs files Corresponding constructors and ID: 156216
Download Presentation The PPT/PDF document "Directory-File System Exercise" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Directory-File System ExerciseSlide2
Figure 44 in HtDPSlide3
Dr-Scheme Related Primitives
Data definition
(define-
struct
file (name size content))
(define-
struct
dir (name
dirs
files))
Corresponding
constructors
and
accessors
that 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
.Slide4
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. Slide5
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