Changeset 15728 in project


Ignore:
Timestamp:
09/03/09 17:53:40 (10 years ago)
Author:
Kon Lovett
Message:

Use of '##sys#expand-home-path' in unix & win posix 'create-directory'. Use of posix 'create-directory' in setup-api for 'create-directory/parents'.

Location:
chicken/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • chicken/trunk/posixunix.scm

    r15719 r15728  
    896896    (lambda (name #!optional parents?)
    897897      (##sys#check-string name 'create-directory)
    898       ; do not pass an empty string to helper-parents
    899       (if (and parents? (not (string=? "" name)))
    900           (create-directory-helper-parents name)
    901           (create-directory-helper name) ) ) ) )
     898      (let ((name (##sys#expand-home-path name)))
     899        ; do not pass an empty string to helper-parents
     900        (if (and parents? (not (string=? "" name)))
     901            (create-directory-helper-parents name)
     902            (create-directory-helper name) ) ) ) ) )
    902903
    903904(define change-directory
  • chicken/trunk/posixwin.scm

    r15543 r15728  
    11861186  (lambda (name #!optional parents?)
    11871187    (##sys#check-string name 'create-directory)
    1188     (if parents?
    1189         (create-directory-helper-parents (canonical-path name))
    1190         (create-directory-helper (canonical-path name)))))
    1191 ;(define create-directory
    1192 ;  (lambda (name)
    1193 ;    (##sys#check-string name 'create-directory)
    1194 ;    (unless (zero? (##core#inline "C_mkdir" (##sys#make-c-string (##sys#expand-home-path name))))
    1195 ;      (##sys#update-errno)
    1196 ;      (##sys#signal-hook #:file-error 'create-directory "cannot create directory" name) ) ) )
     1188    (let ((name (##sys#expand-home-path name)))
     1189      (if parents?
     1190          (create-directory-helper-parents name)
     1191          (create-directory-helper name)))) )
    11971192
    11981193(define change-directory
     
    12601255
    12611256
    1262 (define canonical-path
     1257(define canonical-path                                  ;;DEPRECATED
    12631258    (let ((null?      null?)
    12641259          (char=?     char=?)
  • chicken/trunk/setup-api.scm

    r15646 r15728  
    422422  (make-parameter (or (get-environment-variable "CHICKEN_INSTALL_PREFIX") #f)))
    423423
    424 (define create-directory/parents
    425   (let ()
    426     (define create-directory-0
    427       (let ([create-directory create-directory])
    428         (lambda (dir)
    429           (let loop ([dir dir])
    430             (when (and dir (not (directory? dir)))
    431               (loop (pathname-directory dir))
    432               (create-directory dir))) ) ) )
    433     (define (verb dir)
    434       (when (setup-verbose-mode) (printf "  creating directory `~a'~%~!" dir)) )
    435     (if *windows-shell*
    436         (lambda (dir)
    437           (verb dir)
    438           (create-directory-0 dir) )
    439         (lambda (dir)
    440           (verb dir)
    441           (run (,*mkdir-command* -p ,(shellpath dir))) ) ) ) )
     424(define (create-directory/parents dir)
     425  (when (setup-verbose-mode) (printf "  creating directory `~a'~%~!" dir))
     426  (create-directory dir #t) )
    442427
    443428(define (write-info id files info)
Note: See TracChangeset for help on using the changeset viewer.