{"size": 2208, "ext": "scrbl", "max_stars_repo_path": "share/pkgs/compatibility-doc/mzlib/scribblings/file.scrbl", "max_stars_repo_name": "takikawa/racket-ppa", "max_stars_repo_stars_event_min_datetime": "2018-07-29T04:13:52.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-14T16:11:17.000Z", "max_issues_repo_path": "compatibility-doc/mzlib/scribblings/file.scrbl", "max_issues_repo_name": "NoahStoryM/compatibility", "max_issues_repo_issues_event_min_datetime": "2017-08-25T20:26:37.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T17:48:40.000Z", "max_forks_repo_path": "compatibility-doc/mzlib/scribblings/file.scrbl", "max_forks_repo_name": "NoahStoryM/compatibility", "max_forks_repo_forks_event_min_datetime": "2015-03-09T12:20:01.000Z", "max_forks_repo_forks_event_max_datetime": "2021-10-09T05:02:56.000Z"}
{"max_stars_count": 10, "max_issues_count": 15, "max_forks_count": 8, "avg_line_length": 32.9552238806, "max_line_length": 97, "alphanum_fraction": 0.5063405797}
#lang scribble/doc
@(require "common.rkt"
          (for-label mzlib/file
                     scheme/contract))


@mzlib[#:mode title file]

@deprecated[@racketmodname[racket/file]]{}

The @racketmodname[mzlib/file] library mostly re-exports from
@racketmodname[scheme/file]:

@racketblock[
find-relative-path
explode-path
normalize-path
filename-extension
file-name-from-path
path-only
delete-directory/files
copy-directory/files
make-directory*
make-temporary-file
get-preference
put-preferences
fold-files
find-files
pathlist-closure
]

@deftogether[(
@defproc[(call-with-input-file* [file path-string?] 
                                [proc (input-port? -> any)]
                                [mode (one-of/c 'text 'binary) 'binary])
         any]
@defproc[(call-with-output-file* [file path-string?] 
                                 [proc (output-port? -> any)]
                                 [mode (one-of/c 'text 'binary) 'binary]
                                 [exists (one-of/c 'error 'append 'update
                                                   'replace 'truncate 'truncate/replace) 'error])
         any]
)]{

Like @racket[call-with-input-file]and @racket[call-with-output-file],
except that the opened port is closed if control escapes from the body
of @racket[proc].}

@deftogether[(
@defproc[(build-relative-path [base (or/c path-string?
                                          (one-of/c 'up 'same))]
                              [sub (or/c (and/c path-string? 
                                                relative-path?)
                                         (one-of/c 'up 'same))] ...)
         (and/c path? relative-path?)]
@defproc[(build-absolute-path [base (or/c (and/c path-string?
                                                 (not/c relative-path?))
                                          (one-of/c 'up 'same))]
                              [sub (or/c (and/c path-string? 
                                                (not/c complete-path?))
                                         (one-of/c 'up 'same))] ...)
         (and/c path? absolute-path?)]
)]{

Like @racket[build-path], but with extra constraints to ensure a
relative or absolute result.}
