Changeset 35370 in project


Ignore:
Timestamp:
03/31/18 20:08:08 (6 months ago)
Author:
kon
Message:

rel 1.1.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/directory-utils

    r34137 r35370  
    1010=== pathname?
    1111
    12 <procedure>(pathname? OBJ) => boolean</procedure>
    13 
    14 Does not verify existence of the file, just whether it has dir+fil.
    15 
    16 <procedure>(check-pathname LOCATION OBJECT [ARGNAM]) => *</procedure>
     12<procedure>(pathname? OBJ) -> boolean</procedure>
     13
     14Does not verify existence of the file, just whether the pathname has a
     15directory and/or file component.
     16
     17<procedure>(check-pathname LOCATION OBJECT [ARGNAM]) -> pathname</procedure>
    1718<procedure>(error-pathname LOCATION OBJECT [ARGNAM])</procedure>
    1819
    1920=== filename?
    2021
    21 <procedure>(filename? OBJ) => boolean</procedure>
    22 
    23 Does not verify existence of the file, just whether it doesn't have dir.
    24 
    25 <procedure>(check-filename LOCATION OBJECT [ARGNAM]) => *</procedure>
     22<procedure>(filename? OBJ) -> boolean</procedure>
     23
     24Does not verify existence of the file, just whether it has a
     25directory component.
     26
     27=== check-filename
     28=== error-filename
     29
     30<procedure>(check-filename LOCATION OBJECT [ARGNAM]) -> filename</procedure>
    2631<procedure>(error-filename LOCATION OBJECT [ARGNAM])</procedure>
    2732
    2833=== dot-filename?
    2934
    30 <procedure>(dot-filename? PATHNAME) => boolean</procedure>
     35<procedure>(dot-filename? PATHNAME) -> boolean</procedure>
    3136
    3237Does the {{OBJECT}} name a file with a dot-name?
     
    3641=== dot-pathname?
    3742
    38 <procedure>(dot-pathname? PATHNAME) => boolean</procedure>
    39 
    40 Is any dir in the {{PATHNAME}} a dot-filename?
     43<procedure>(dot-pathname? PATHNAME) -> boolean</procedure>
     44
     45Is any directory in the {{PATHNAME}} a dot-filename?
    4146
    4247Does not verify existence of the file!
     
    4449=== check-directory
    4550
    46 <procedure>(check-directory LOCATION OBJECT [ARGNAM]) => *</procedure>
     51<procedure>(check-directory LOCATION OBJECT [ARGNAM]) -> directoryname</procedure>
    4752
    4853Does the {{OBJECT}} name an existing {{directory}}>
     
    5257=== directory-fold
    5358
    54 <procedure>(directory-fold FUNCTION IDENTITY DIRECTORY [#:dotfiles? DOTFILES?]) => *</procedure>
     59<procedure>(directory-fold FUNCTION IDENTITY DIRECTORY [#:dotfiles? DOTFILES?]) -> *</procedure>
    5560
    5661Invokes {{FUNCTION}} on each {{filename}} in the {{DIRECTORY}} and the
    5762recursive value from {{IDENTITY}}. Returns the final value.
     63
     64; {{FUNCTION}} : {{(filename * -> *)}}.
     65; {{DOTFILES}} : {{boolean}} ; include files with a {{"."}} prefix ; Default {{#f}}.
    5866
    5967''Note'' that only the {{filename}} is passed and not the complete
     
    6169{{DOTFILES?}} setting.
    6270
    63 {{FUNCTION}} is a {{(procedure (filename *) *)}}.
    64 
    65 {{DOTFILES}} is a {{boolean}} indicating whether files with a {{"."}} prefix
    66 are included in the fold. Default is {{#f}}.
    67 
    68 On a '''Windows''' platform hidden files have a {{hidden}} attribute so this
    69 routine is rather '''*nix''' centric.
     71On a ''Windows'' platform hidden files have a {{hidden}} attribute so this
     72routine is rather ''*nix'' centric.
    7073
    7174=== create-pathname-directory
     
    7578Ensures the directory component of {{PATHNAME}} exist.
    7679
    77 Like the '''*nix''' `"mkdir -p `dirname PATHNAME`" command.
     80Like the ''*nix'' `"mkdir -p `dirname PATHNAME`" command.
    7881
    7982=== make-program-filename
    8083
    81 <procedure>(make-program-filename COMMAND) => *</procedure>
     84<procedure>(make-program-filename COMMAND) -> *</procedure>
    8285
    8386Returns the platform specific form of an executable command filename.
    8487
    85 On '''Windows''' the {{"exe"}} extension is added unless an extension is already
     88On ''Windows'' the {{"exe"}} extension is added unless an extension is already
    8689present. Does nothing otherwise.
    8790
    8891=== make-shell-filename
    8992
    90 <procedure>(make-shell-filename COMMAND) => *</procedure>
     93<procedure>(make-shell-filename COMMAND) -> *</procedure>
    9194
    9295Returns the platform specific form of a shell command filename.
    9396
    94 On '''Windows''' the {{"bat"}} extension is added unless an extension is already present.
     97On ''Windows'' the {{"bat"}} extension is added unless an extension is already present.
    9598Otherwise conditionally adds the {{"sh"}} extension.
    9699
    97 === file-exists/directory?
    98 
    99 <procedure>(file-exists/directory? FILENAME [DIRECTORY | DIRECTORY-LIST]) => (or #f pathname)</procedure>
    100 
    101 Returns the pathname when {{FILENAME}} exists in the {{DIRECTORY}}, otherwise #f.
    102 
    103 {{DIRECTORY-LIST}} is as for make-pathname.
     100=== file-exists-in-directory?
     101
     102<procedure>(file-exists-in-directory? FILENAME [DIRECTORY ...]) -> (or #f pathname)</procedure>
     103
     104Returns the pathname when {{FILENAME}} exists in the {{DIRECTORY ...}},
     105otherwise #f.
     106
     107{{DIRECTORY ...}} as make-pathname.
    104108
    105109When only the {{FILENAME}} argument supplied then the same as file-exists?.
     
    107111=== find-file-pathnames
    108112
    109 <procedure>(find-file-pathnames FILENAME [DIRECTORY | DIRECTORY-LIST] ...) => (or #f (list-of pathname))</procedure>
     113<procedure>(find-file-pathnames FILENAME [DIRECTORY | DIRECTORY-LIST] ...) -> (or #f (list-of pathname))</procedure>
    110114
    111115Returns a list of all pathnames found for {{FILENAME}} in the supplied
     
    116120=== find-program-pathnames
    117121
    118 <procedure>(find-program-pathnames COMMAND-NAME [DIRECTORY | DIRECTORY-LIST] ...) => (or #f (list-of pathname))</procedure>
     122<procedure>(find-program-pathnames COMMAND-NAME [DIRECTORY | DIRECTORY-LIST] ...) -> (or #f (list-of pathname))</procedure>
    119123
    120124Returns a list of all pathnames found for {{COMMAND-NAME}} in the supplied
     
    123127Uses make-program-filename to make a filename.
    124128
    125 On '''Windows''' also uses make-shell-filename to make a filename.
     129On ''Windows'' also uses make-shell-filename to make a filename.
    126130
    127131Does not ensure that the file is executable!
     
    129133=== which-command-pathnames
    130134
    131 <procedure>(which-command-pathnames COMMAND-NAME [ENVIRONMENT-VARIABLE]) => (or #f (list-of pathname))</procedure>
     135<procedure>(which-command-pathnames COMMAND-NAME [ENVIRONMENT-VARIABLE]) -> (or #f (list-of pathname))</procedure>
    132136
    133137Returns the pathnames of {{COMMAND-NAME}} in the {{ENVIRONMENT-VARIABLE}}
     
    137141
    138142Uses the platform specific "PATH" environment variable element separator - a
    139 {{#\;}} for '''Windows''', and a {{#\:}} otherwise.
     143''Windows'' {{#\;}}, and a ''*nix'' {{#\:}}.
    140144
    141145=== which-command-pathname
    142146
    143 <procedure>(which-command-pathname COMMAND-NAME [ENVIRONMENT-VARIABLE]) => (or #f pathname)</procedure>
     147<procedure>(which-command-pathname COMMAND-NAME [ENVIRONMENT-VARIABLE]) -> (or #f pathname)</procedure>
    144148
    145149Same as which-command-pathnames but returns the first pathname only.
    146150
    147 Like the '''*nix''' `which COMMAND-NAME` command.
     151Like the ''*nix'' `which COMMAND-NAME` command.
    148152
    149153=== remove-dotfiles
     
    155159==== Directory Stack
    156160
     161===== directory-utility-stack
     162
     163<parameter>(directory-utility-stack [STACK]) -> stack</parameter>
     164
     165Which {{stack}} to use for directory stack operations.
     166
     167{{stack}} is from [[stack]].
     168
    157169===== push-directory
    158170
     
    163175===== pop-directory
    164176
    165 <procedure>(pop-directory) => string</procedure>
     177<procedure>(pop-directory) -> string</procedure>
    166178
    167179Pop the last directory and change to it.
     
    169181===== pop-toplevel-directory
    170182
    171 <procedure>(pop-toplevel-directory) => string</procedure>
     183<procedure>(pop-toplevel-directory) -> string</procedure>
    172184
    173185Pop the earliest directory and change to it.
     
    188200== Version history
    189201
     202; 1.1.0 : Add types.
    190203; 1.0.6 : fix test.
    191 ; 1.0.3 : more tests.
     204; 1.0.3 : More tests.
    192205; 1.0.2 : Deprecated {{create-directory/parents}}.
    193206; 1.0.1 :
     
    197210== License
    198211
    199 Copyright (C) 2010-2017 Kon Lovett.  All rights reserved.
     212Copyright (C) 2010-2018 Kon Lovett.  All rights reserved.
    200213
    201214Permission is hereby granted, free of charge, to any person obtaining a
Note: See TracChangeset for help on using the changeset viewer.