cs: protect special filenames from directory-list
For example, return `\\?\REL\\aux` instead of `aux`.
This commit is contained in:
parent
9867d11d68
commit
6805145e10
|
@ -3,12 +3,14 @@
|
|||
"../path/complete.rkt"
|
||||
"../path/parameter.rkt"
|
||||
"../path/cleanse.rkt"
|
||||
"../path/protect.rkt"
|
||||
"../host/rktio.rkt"
|
||||
"../security/main.rkt")
|
||||
|
||||
(provide ->host
|
||||
->host/as-is
|
||||
host->)
|
||||
host->
|
||||
host-element->)
|
||||
|
||||
;; Note: `(host-> (->host x who flags))` is not the same as `x`, since
|
||||
;; it normalizes `x`. That's why `(host-> (->host x))` is generally
|
||||
|
@ -31,3 +33,9 @@
|
|||
(define (host-> s)
|
||||
(path (bytes->immutable-bytes s)
|
||||
(system-path-convention-type)))
|
||||
|
||||
(define (host-element-> s)
|
||||
(if (eq? 'windows (system-path-convention-type))
|
||||
(path (protect-path-element (bytes->immutable-bytes s) 'windows)
|
||||
'windows)
|
||||
(host-> s)))
|
||||
|
|
|
@ -146,7 +146,7 @@
|
|||
[else
|
||||
(rktio_free fnp)
|
||||
(end-atomic)
|
||||
(loop (cons (host-> fn) accum))]))])))))
|
||||
(loop (cons (host-element-> fn) accum))]))])))))
|
||||
|
||||
(define/who (delete-file p)
|
||||
(check who path-string? p)
|
||||
|
|
Loading…
Reference in New Issue
Block a user