<commit_before>#lang scribble/doc
@require["mz.ss"
         (for-label scheme/system)]

@title[#:tag "subprocess"]{Processes}

@defproc*[([(subprocess [stdout (or/c output-port? false/c)]
                        [stdin (or/c input-port? false/c)]
                        [stderr (or/c output-port? false/c)]
                        [command path-string?]
                        [arg string?] ...)
            (values subprocess?
                    (or/c input-port? false/c)
                    (or/c output-port? false/c)
                    (or/c input-port? false/c))]
           [(subprocess [stdout (or/c output-port? false/c)]
                        [stdin (or/c input-port? false/c)]
                        [stderr (or/c output-port? false/c)]
                        [command path-string?]
                        [exact (one-of/c 'exact)]
                        [arg string?])
            (values subprocess?
                    (or/c input-port? false/c)
                    (or/c output-port? false/c)
                    (or/c input-port? false/c))])]{

Creates a new process in the underlying operating system to execute
@scheme[command] asynchronously. See also @scheme[system] and
@scheme[process] from @schememodname[scheme/system].

The @scheme[command] argument is a path to a program executable, and
the @scheme[arg]s are command-line arguments for the program. Under
Unix and Mac OS X, command-line arguments are passed as byte strings
using the current locale's encoding (see @secref["encodings"]).

Under Windows, the first @scheme[arg] can be replaced
@indexed-scheme['exact], which triggers a Windows-specific behavior:
the sole @scheme[arg] is used exactly as the command-line for the
subprocess. Otherwise, under Windows, a command-line string is
constructed from @scheme[command] and @scheme[arg] so that a typical
Windows console application can parse it back to an array of
arguments. If @scheme['exact] is provided on a non-Windows platform,
the @exnraise[exn:fail:contract].

@margin-note{For information on the Windows command-line conventions,
search for ``command line parsing'' at
@tt{http://msdn.microsoft.com/}.}

Unless it is @scheme[#f], @scheme[stdout] is used for the launched
process's standard output, @scheme[stdin] is used for the process's
standard input, and @scheme[stderr] is used for the process's standard
error.  All provided ports must be file-stream ports. Any of the ports<commit_msg>typo<commit_after>#lang scribble/doc
@require["mz.ss"
         (for-label scheme/system)]

@title[#:tag "subprocess"]{Processes}

@defproc*[([(subprocess [stdout (or/c output-port? false/c)]
                        [stdin (or/c input-port? false/c)]
                        [stderr (or/c output-port? false/c)]
                        [command path-string?]
                        [arg string?] ...)
            (values subprocess?
                    (or/c input-port? false/c)
                    (or/c output-port? false/c)
                    (or/c input-port? false/c))]
           [(subprocess [stdout (or/c output-port? false/c)]
                        [stdin (or/c input-port? false/c)]
                        [stderr (or/c output-port? false/c)]
                        [command path-string?]
                        [exact (one-of/c 'exact)]
                        [arg string?])
            (values subprocess?
                    (or/c input-port? false/c)
                    (or/c output-port? false/c)
                    (or/c input-port? false/c))])]{

Creates a new process in the underlying operating system to execute
@scheme[command] asynchronously. See also @scheme[system] and
@scheme[process] from @schememodname[scheme/system].

The @scheme[command] argument is a path to a program executable, and
the @scheme[arg]s are command-line arguments for the program. Under
Unix and Mac OS X, command-line arguments are passed as byte strings
using the current locale's encoding (see @secref["encodings"]).

Under Windows, the first @scheme[arg] can be replaced with
@indexed-scheme['exact], which triggers a Windows-specific behavior:
the sole @scheme[arg] is used exactly as the command-line for the
subprocess. Otherwise, under Windows, a command-line string is
constructed from @scheme[command] and @scheme[arg] so that a typical
Windows console application can parse it back to an array of
arguments. If @scheme['exact] is provided on a non-Windows platform,
the @exnraise[exn:fail:contract].

@margin-note{For information on the Windows command-line conventions,
search for ``command line parsing'' at
@tt{http://msdn.microsoft.com/}.}

Unless it is @scheme[#f], @scheme[stdout] is used for the launched
process's standard output, @scheme[stdin] is used for the process's
standard input, and @scheme[stderr] is used for the process's standard
error.  All provided ports must be file-stream ports. Any of the ports
{'fraction_non_alphanumeric': 0.11015561015561015, 'fraction_numerical': 0.0, 'mean_word_length': 2.4596317280453257, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4815706', 'n_tokens_mistral': 1405, 'n_tokens_neox': 1336, 'n_words': 488}