Mercurial > hg > jslab
comparison src/scheme/props.scm @ 0:bf79fb79ee13
Initial Mercurial check in.
author | samer |
---|---|
date | Tue, 17 Jan 2012 17:50:20 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:bf79fb79ee13 |
---|---|
1 ; __________________________________________ | |
2 ; open local args file and push on to environment stack | |
3 ; this will now accept all stored data. also adds agent to | |
4 ; save on exit. | |
5 | |
6 (define local-props null) | |
7 (define local-file null) | |
8 (define (push-properties file) | |
9 (set! local-props (samer.core.util.Properties. (Shell.env))) | |
10 (set! local-file file) | |
11 (tryCatch | |
12 (.load local-props (java.io.FileInputStream. file)) | |
13 (lambda (e) (Shell.trace (string-append "failed to load")))) | |
14 (Shell.push local-props) | |
15 | |
16 ;;; this changes to global exit procedure to save the local | |
17 ;;; properties as well as the regular properties | |
18 (set! exit (lambda () | |
19 (display (string-append "saving local properites to " local-file)) | |
20 (.save local-props (java.io.FileOutputStream. local-file)) | |
21 (Shell.interpret "exit") | |
22 (System.exit 0) | |
23 )) | |
24 ) | |
25 | |
26 |