aboutsummaryrefslogtreecommitdiff
path: root/module/vcomponent/parse.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-06-25 18:15:32 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-06-25 18:25:33 +0200
commit7dc9e082426cd6c81310c2f78088b5b613bd0c10 (patch)
tree4f3f2295eef117bc539677775f63c1c16fc6bacc /module/vcomponent/parse.scm
parentICS writer now handles types and parameters. (diff)
downloadcalp-7dc9e082426cd6c81310c2f78088b5b613bd0c10.tar.gz
calp-7dc9e082426cd6c81310c2f78088b5b613bd0c10.tar.xz
Add structure for importing events.
Diffstat (limited to 'module/vcomponent/parse.scm')
-rw-r--r--module/vcomponent/parse.scm6
1 files changed, 4 insertions, 2 deletions
diff --git a/module/vcomponent/parse.scm b/module/vcomponent/parse.scm
index 960fb6eb..b20fcfc8 100644
--- a/module/vcomponent/parse.scm
+++ b/module/vcomponent/parse.scm
@@ -105,17 +105,19 @@
;; Parse a vdir or ics file at the given path.
(define-public (parse-cal-path path)
+ ;; TODO check (access? path R_OK) ?
(define st (stat path))
(define cal
(case (stat:type st)
[(regular)
(let ((comp (call-with-input-file path parse-calendar)))
- (set! (attr comp 'X-HNH-SOURCETYPE) "file")
+ (set! (attr comp 'X-HNH-SOURCETYPE) 'file)
comp) ]
[(directory)
(report-time! "Parsing ~a" path)
(let ((comp (parse-vdir path)))
- (set! (attr comp 'X-HNH-SOURCETYPE) "vdir")
+ (set! (attr comp 'X-HNH-SOURCETYPE) 'vdir
+ (attr comp 'X-HNH-DIRECTORY) path)
comp)]
[(block-special char-special fifo socket unknown symlink)
=> (lambda (t) (error "Can't parse file of type " t))]))