Changeset 20913 in project


Ignore:
Timestamp:
10/21/10 00:50:10 (8 years ago)
Author:
kon
Message:

Dep of create-directory/parents.

Location:
release/4/directory-utils
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • release/4/directory-utils/tags/1.0.2/directory-utils.meta

    r20284 r20913  
    22
    33((egg "directory-utils.egg")
    4  (category io #;misc)
     4 (category io)
    55 (author "[[kon lovett]]")
    66 (license "BSD")
  • release/4/directory-utils/tags/1.0.2/directory-utils.scm

    r20284 r20913  
    11;;;; directory-utils.scm
    22;;;; Kon Lovett, Aug '10
     3
     4;; Issues
     5;;
     6;; - See scattered 'FIXME' entries.
    37
    48(module directory-utils
     
    1317    pop-directory
    1418    pop-toplevel-directory
    15     create-directory/parents
    1619    create-pathname-directory
    1720    make-program-filename
     
    2225    which-command-pathnames
    2326    which-command-pathname
    24     remove-dotfiles)
     27    remove-dotfiles
     28    ; DEPRECATED
     29    create-directory/parents)
    2530
    2631  (import
     
    6065  (else     (define-constant PATH-DELIMITER ":")))
    6166
    62 (define (dot-prefix? str)
    63   (and (not (or (string=? "." str) (string=? ".." str)))
    64        (string-prefix? "." str)) )
     67(define +dot-directory+ (make-pathname "." #f))
     68
     69(define (dot-filename-prefix? str)
     70  (and (string-prefix? "." str)
     71       (not (or (string=? "." str) (string=? ".." str)))) )
    6572
    6673(define (pathname-maybe? obj) (string? obj))
    67 
    68 (define dot-directory (make-pathname "." #f))
    6974
    7075;;;
     
    9499(define-check+error-type filename)
    95100
     101;;
     102
     103(define (dot-filename? obj)
     104  (and (filename? obj)
     105       (dot-filename-prefix? obj)) )
     106
    96107;; Any pathname component is a dot-filename?
    97108
     
    99110  (and (pathname-maybe? obj)
    100111       (let-values (((dir fil ext) (decompose-pathname obj)))
    101          (or (dot-prefix? fil)
     112         (or (dot-filename-prefix? fil)
    102113             (let-values (((org dir elts) (decompose-directory dir)))
    103114               (and elts
    104                     (any dot-prefix? elts)))))) )
    105 
    106 ;;
    107 
    108 (define (dot-filename? obj)
    109   (and (filename? obj)
    110        (dot-prefix? obj)) )
     115                    (any dot-filename-prefix? elts)))))) )
    111116
    112117;; Remove dot files from a directory list
     
    116121
    117122;;
     123
     124;FIXME need a routine that provides filename and stat info to the fold func.
     125;The stat info should include platform specific info as well: the Windows Hidden
     126;attribute, the MacOS X birthtime, etc.
    118127
    119128(define (directory-fold func ident dir #!key (dotfiles? #f))
     
    124133
    125134;; Directory Stack
     135
     136;FIXME should be "thread local storage" for the directory-stack.
    126137
    127138(define push-directory)
     
    137148      (when (and dir
    138149                 (not (or (string-null? dir)
    139                           (string=? dot-directory (make-pathname dir #f)))))
     150                          (string=? +dot-directory+ (make-pathname dir #f)))))
    140151        (current-directory dir) ) ) )
    141152
     
    165176
    166177(define (create-pathname-directory pathname)
    167  (check-pathname 'create-pathname-directorys pathname)
    168  (create-directory/parents (pathname-directory pathname)) )
     178 (check-pathname 'create-pathname-directory pathname)
     179 (create-directory (pathname-directory pathname) #t) )
    169180
    170181;; Platform specific program filename.
     
    174185    (windows
    175186      (if (pathname-extension bn) bn
    176         (make-pathname #f bn ".exe")))
     187        (make-pathname #f bn "exe")))
    177188    (else
    178189      bn)) )
     
    182193    (windows
    183194      (if (pathname-extension bn) bn
    184         (make-pathname #f bn ".bat")))
     195        (make-pathname #f bn "bat")))
    185196    (else
    186197      (if (pathname-extension bn) bn
    187         (make-pathname #f bn ".sh")))) )
     198        (make-pathname #f bn "sh")))) )
    188199
    189200;; Pathname if file exists in directory.
  • release/4/directory-utils/tags/1.0.2/directory-utils.setup

    r20284 r20913  
    1111  "check-errors"       "1.11.0")
    1212
    13 (setup-shared-extension-module 'directory-utils (extension-version "1.0.0")
     13(setup-shared-extension-module 'directory-utils (extension-version "1.0.2")
    1414  #:compile-options '(
    1515    -scrutinize
  • release/4/directory-utils/trunk/directory-utils.meta

    r20284 r20913  
    22
    33((egg "directory-utils.egg")
    4  (category io #;misc)
     4 (category io)
    55 (author "[[kon lovett]]")
    66 (license "BSD")
  • release/4/directory-utils/trunk/directory-utils.scm

    r20284 r20913  
    11;;;; directory-utils.scm
    22;;;; Kon Lovett, Aug '10
     3
     4;; Issues
     5;;
     6;; - See scattered 'FIXME' entries.
    37
    48(module directory-utils
     
    1317    pop-directory
    1418    pop-toplevel-directory
    15     create-directory/parents
    1619    create-pathname-directory
    1720    make-program-filename
     
    2225    which-command-pathnames
    2326    which-command-pathname
    24     remove-dotfiles)
     27    remove-dotfiles
     28    ; DEPRECATED
     29    create-directory/parents)
    2530
    2631  (import
     
    6065  (else     (define-constant PATH-DELIMITER ":")))
    6166
    62 (define (dot-prefix? str)
    63   (and (not (or (string=? "." str) (string=? ".." str)))
    64        (string-prefix? "." str)) )
     67(define +dot-directory+ (make-pathname "." #f))
     68
     69(define (dot-filename-prefix? str)
     70  (and (string-prefix? "." str)
     71       (not (or (string=? "." str) (string=? ".." str)))) )
    6572
    6673(define (pathname-maybe? obj) (string? obj))
    67 
    68 (define dot-directory (make-pathname "." #f))
    6974
    7075;;;
     
    9499(define-check+error-type filename)
    95100
     101;;
     102
     103(define (dot-filename? obj)
     104  (and (filename? obj)
     105       (dot-filename-prefix? obj)) )
     106
    96107;; Any pathname component is a dot-filename?
    97108
     
    99110  (and (pathname-maybe? obj)
    100111       (let-values (((dir fil ext) (decompose-pathname obj)))
    101          (or (dot-prefix? fil)
     112         (or (dot-filename-prefix? fil)
    102113             (let-values (((org dir elts) (decompose-directory dir)))
    103114               (and elts
    104                     (any dot-prefix? elts)))))) )
    105 
    106 ;;
    107 
    108 (define (dot-filename? obj)
    109   (and (filename? obj)
    110        (dot-prefix? obj)) )
     115                    (any dot-filename-prefix? elts)))))) )
    111116
    112117;; Remove dot files from a directory list
     
    116121
    117122;;
     123
     124;FIXME need a routine that provides filename and stat info to the fold func.
     125;The stat info should include platform specific info as well: the Windows Hidden
     126;attribute, the MacOS X birthtime, etc.
    118127
    119128(define (directory-fold func ident dir #!key (dotfiles? #f))
     
    124133
    125134;; Directory Stack
     135
     136;FIXME should be "thread local storage" for the directory-stack.
    126137
    127138(define push-directory)
     
    137148      (when (and dir
    138149                 (not (or (string-null? dir)
    139                           (string=? dot-directory (make-pathname dir #f)))))
     150                          (string=? +dot-directory+ (make-pathname dir #f)))))
    140151        (current-directory dir) ) ) )
    141152
     
    165176
    166177(define (create-pathname-directory pathname)
    167  (check-pathname 'create-pathname-directorys pathname)
    168  (create-directory/parents (pathname-directory pathname)) )
     178 (check-pathname 'create-pathname-directory pathname)
     179 (create-directory (pathname-directory pathname) #t) )
    169180
    170181;; Platform specific program filename.
     
    174185    (windows
    175186      (if (pathname-extension bn) bn
    176         (make-pathname #f bn ".exe")))
     187        (make-pathname #f bn "exe")))
    177188    (else
    178189      bn)) )
     
    182193    (windows
    183194      (if (pathname-extension bn) bn
    184         (make-pathname #f bn ".bat")))
     195        (make-pathname #f bn "bat")))
    185196    (else
    186197      (if (pathname-extension bn) bn
    187         (make-pathname #f bn ".sh")))) )
     198        (make-pathname #f bn "sh")))) )
    188199
    189200;; Pathname if file exists in directory.
  • release/4/directory-utils/trunk/directory-utils.setup

    r20284 r20913  
    1111  "check-errors"       "1.11.0")
    1212
    13 (setup-shared-extension-module 'directory-utils (extension-version "1.0.0")
     13(setup-shared-extension-module 'directory-utils (extension-version "1.0.2")
    1414  #:compile-options '(
    1515    -scrutinize
Note: See TracChangeset for help on using the changeset viewer.