Loris  Check-in [d9a974c943]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Unbreak import of DELETE-FILE and cleanup. The DELETE-FILE procedure should be imported from the module chicken. There is no need to import (scheme process-context) twice. Also, imported Chicken-specific procedures used only within the platform module have been prefixed with "chicken:"
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:d9a974c943609f638a4a6c2d9af4f66cf2468914
User & Date: jesper 2016-08-01 10:23:22
Context
2018-07-18
10:36
Sync with reality check-in: 062eea3a09 user: jesper tags: trunk
2016-08-01
10:23
Unbreak import of DELETE-FILE and cleanup. The DELETE-FILE procedure should be imported from the module chicken. There is no need to import (scheme process-context) twice. Also, imported Chicken-specific procedures used only within the platform module have been prefixed with "chicken:" check-in: d9a974c943 user: jesper tags: trunk
10:01
Add random-integer procedure to the platform module, and use it in dot-locking instead of using srfi 27. The srfi 27 egg is broken on Windows/MSYS2. The random procedure of Chickens extras module is good enough for our purposes here. check-in: f246cdf6ff user: jesper tags: trunk
Changes

Changes to platform.scm.

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

37
38
39

40
41
42
43
44
45
46
...
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130

(use r7rs)

(define-library (loris platform)
  (import (scheme base)
          (scheme char)		; XXX: "not unicode-aware" / r7rs egg ref
          (scheme case-lambda)
          (scheme process-context)
          (scheme file)
          (scheme process-context)
          (srfi 1)
          (srfi 13)
          (srfi 14)
          (loris convenience)
          (loris output)
          (prefix (loris version) version:)

          ;; XXX: Chicken-specific
          (prefix (only (extras)
                        randomize random)	; used here, not exported
                  chicken:)
          (only (posix)
                process process-wait ; used here, not exported

                file-modification-time file-link current-directory) ; reexported only
          (only (files) 	; all these are reexported
                make-absolute-pathname absolute-pathname? normalize-pathname

                delete-file))	; reexported and used here for delete-filename*
  (export program-name
          stderr-to-null
          platform-dir-slashes
          program-available?
          ref
          init
................................................................................
            (nor (find pred? '(#\/ #\null))
                 (and accept-allowed-but-ugly
                      (find pred? '(#\| #\; #\* #\[ #\])))))))

    (define (program-available? str)
      (let ((available? (if (eq? 'windows (software-type))
                            (or (file-exists? str) (file-exists? (conc str ".exe")))
                            (let*-values (((in out pid) (process (conc "which " str " 2> /dev/null")))
                                          ((pid ok status) (process-wait pid)))
                              (= 0 status)))))
        (debug* prepend: (conc "Checking availability of program " str)
                available?)))

    (define (delete-file* fn)
      (with-exception-handler* (lambda (x) #f) (delete-file fn)))








<













|
|
>
|

|
>







 







|
|







14
15
16
17
18
19
20

21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
...
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131

(use r7rs)

(define-library (loris platform)
  (import (scheme base)
          (scheme char)		; XXX: "not unicode-aware" / r7rs egg ref
          (scheme case-lambda)

          (scheme file)
          (scheme process-context)
          (srfi 1)
          (srfi 13)
          (srfi 14)
          (loris convenience)
          (loris output)
          (prefix (loris version) version:)

          ;; XXX: Chicken-specific
          (prefix (only (extras)
                        randomize random)	; used here, not exported
                  chicken:)
          (prefix (only (posix)
                        process process-wait) ; used here, not exported
                  chicken:)
          (only (posix) file-modification-time file-link current-directory) ; reexported only
          (only (files) 	; all these are reexported
                make-absolute-pathname absolute-pathname? normalize-pathname)
          (only (chicken)
                delete-file))	; reexported and used here for delete-filename*
  (export program-name
          stderr-to-null
          platform-dir-slashes
          program-available?
          ref
          init
................................................................................
            (nor (find pred? '(#\/ #\null))
                 (and accept-allowed-but-ugly
                      (find pred? '(#\| #\; #\* #\[ #\])))))))

    (define (program-available? str)
      (let ((available? (if (eq? 'windows (software-type))
                            (or (file-exists? str) (file-exists? (conc str ".exe")))
                            (let*-values (((in out pid) (chicken:process (conc "which " str " 2> /dev/null")))
                                          ((pid ok status) (chicken:process-wait pid)))
                              (= 0 status)))))
        (debug* prepend: (conc "Checking availability of program " str)
                available?)))

    (define (delete-file* fn)
      (with-exception-handler* (lambda (x) #f) (delete-file fn)))