27 lines
623 B
Scheme
27 lines
623 B
Scheme
(define-record-type fs-object :fs-object
|
|
(really-make-fs-object name path info)
|
|
fs-object?
|
|
(name fs-object-name)
|
|
(path fs-object-path)
|
|
(info fs-object-info))
|
|
|
|
(define (make-fs-object name path)
|
|
(really-make-fs-object
|
|
name path
|
|
(file-info (combine-path path name))))
|
|
|
|
(define-record-discloser :fs-object
|
|
(lambda (r)
|
|
`(fs-object ,(fs-object-name r))))
|
|
|
|
(define (combine-path parent name)
|
|
(if (string=? parent "")
|
|
name
|
|
(string-append parent
|
|
"/"
|
|
name)))
|
|
|
|
(define (fs-object-complete-path fs-object)
|
|
(combine-path (fs-object-path fs-object)
|
|
(fs-object-name fs-object)))
|