diff --git a/src/standard-library/std-fmt.md b/src/standard-library/std-fmt.md index bda67c1..a190d60 100644 --- a/src/standard-library/std-fmt.md +++ b/src/standard-library/std-fmt.md @@ -26,19 +26,47 @@ And does not increase argument list offset. ```jule fn printf(fmt: str, args: ...any) ``` -Prints result of formatting. See documentation of format function for formatting. +Prints result of formatting to stdout. See documentation of format function for formatting. --- ```jule fn print(args: ...any) ``` -Prints arguments by default formatting. +Prints arguments by default formatting to stdout. --- ```jule fn println(args: ...any) ``` -Prints arguments by default formatting. +Prints arguments by default formatting to stdout. Prints new-line after arguments. + +--- + +```jule +fn fprint(mut f: &File, args: ...any) +``` +Prints arguments to file by default formatting. See documentation of format function for formatting. + +--- + +```jule +fn fprintln(mut f: &File, args: ...any) +``` +Prints arguments to file by default formatting. Prints new-line after arguments. See documentation of format function for formatting. + +--- + +```jule +fn fprintf(mut f: &File, fmt: str, args: ...any) +``` +Prints result of formatting to file. See documentation of format function for formatting. + +--- + +```jule +fn sprint(args: ...any): str +``` +Returns string result of arguments by default formatting. diff --git a/src/standard-library/std-fs.md b/src/standard-library/std-fs.md index b97369e..f4255a2 100644 --- a/src/standard-library/std-fs.md +++ b/src/standard-library/std-fs.md @@ -101,6 +101,10 @@ struct File ``` The file stream handle. +It works like a wrapper when it comes to console handle like stdin, stdout or stderr. Read and write functions are supported for console handlers. The rest of the functions are not supported and not checked, it is undefined behavior. + +There may be system call differences and performance differences for console handlers depending on the operating system. For example, Windows has an overhead for UTF-16 processing. + **Methods:** `static fn new(handle: uintptr): &File`\ diff --git a/src/standard-library/std-io.md b/src/standard-library/std-io.md index af8ef0f..fe698e4 100644 --- a/src/standard-library/std-io.md +++ b/src/standard-library/std-io.md @@ -1,4 +1,25 @@ # std::io +## Globals + +```jule +static mut STDIN: &File +``` +File handler for stdin. + +--- + +```jule +static mut STDOUT: &File +``` +File handler for stdout. + +--- + +```jule +static mut STDERR: &File +``` +File handler for stderr. + ## Functions ```jule fn readln(): str