File Utilities
Erich Rast <erich ’at snafu.de>
1 Introduction
The File Utilities library is a collection of helper functions for dealing with paths and files.
Note: Most of this library has been developed for older versions of Racket. You should check if there is a built-in Racket library function with the same functionality before using one from this library.
2 Function Reference
(require (planet erast/file-utils:1:=0)) |
procedure
(get-file-or-folder-name file-path) → string?
file-path : (or/c string? path?)
procedure
(name-as-string file-path) → string?
file-path : (or/c string? path?)
procedure
(filename-main file-path) → string?
file-path : (or/c string? path?)
procedure
(filename-suffix file-path) → string?
file-path : (or/c string? path?)
procedure
(compose-name name n suffix) → string?
name : string? n : (or/c number? boolean?) suffix : string?
procedure
(parent-directory path) → (or/c path? boolean/c)
path : path?
procedure
(make-unique-path suggested-path) → path?
suggested-path : path?
procedure
(path-equal? p1 p2) → boolean/c
p1 : path? p2 : path?
procedure
(move-folder-to source-directory destination-directory) → void/c source-directory : path? destination-directory : path?
procedure
(copy-folders/renaming source-directory dest-directory pred?) → void/c source-directory : path? dest-directory : path? pred? : (path? .->. boolean/c)
procedure
(file-is-visible? file) → boolean/c
file : path?
procedure
(count-lines [port]) → integer/c
port : port? = (current-input-port)
procedure
(move-file-to source target) → void/c
source : path? target : path?
procedure
(file-equal? file1 file2) → boolean/c
file1 : path? file2 : path?