~mrms/osum

4149a119d1be3269ba1c8515a463fb1e06dea759 — Marek Ma┼íkarinec 6 months ago c517cdd
Remove docs
1 files changed, 0 insertions(+), 154 deletions(-)

M README.md
M README.md => README.md +0 -154
@@ 36,157 36,3 @@ fn main() {
## License

Unlicense/MIT

## type Errno

```
type Errno* = int
```

An errno is a number that represents an error. It is 0 on success.

## fn isfile

```
fn isfile*(path: str): bool {
```

Returns true if the given path is a regular file, false otherwise.
If the file doesn't exist, returns false.

## fn isdir

```
fn isdir*(path: str): bool {
```

Returns true if the given path is a directory, false otherwise.
If the directory doesn't exist, returns false.

## fn islink

```
fn islink*(path: str): bool {
```

Returns true if the given path is a symbolic link, false otherwise.
If the link doesn't exist, returns false.

## fn mkdir

```
fn mkdir*(path: str): Errno {
```

Creates a directory at path. Returns 0 on success, or an errno on failure.

## fn mkdirp

```
fn mkdirp*(path: str): Errno {
```

If the directory at path doesn't exist, creates it and all parent
directories. Returns EALREADY if part of the path already exists and is a
file.

## fn remove

```
fn remove*(path: str): Errno {
```

Removes a file at path. Returns 0 on success, or an errno on failure.

## fn strerror

```
fn strerror*(errno: Errno): str {
```

Returns a string describing the given errno.

## fn link

```
fn link*(target: str, link: str): Errno {
```

Creates a symbolic link at link pointing to target. Returns 0 on success, or
an errno on failure.

## fn listdir

```
fn listdir*(path: str): ([]str, Errno) {
```

Returns a list of files in the given directory, second argument is 0 on
success or an errno on failure.

## struct WalkArgs

```
type WalkArgs* = struct {
        excludeDirs: bool // if true, directories will not be walked
        skipLinks: bool   // if true, symbolic links will not be walked
}
```

Arguments to the walk function.

## fn walk

```
fn walk*(dir: str, cb: fn(file: str), args: WalkArgs = {}): Errno {
```

Walks the given directory, calling the given callback for each file.

## fn chmod

```
fn chmod*(path: str, mode: int): Errno {
```

Changes the permissions of the given file. Returns 0 on success, or an
errno on failure.

## enum Platform

```
type Platform* = int
const (
        PlatformPosix* = Platform(0)
        PlatformWindows*
        PlatformEmscripten*
        PlatformUnknown*
)
```

The platform the program is running on.

## fn getPlatform

```
fn getPlatform*(): Platform {
```

Returns the platform the program is running on.

## fn getCwd

```
fn getCwd*(): (str, Errno) {
```

Returns the current working directory.

## fn setEnv

```
fn setEnv*(key: str, value: str): Errno {
```

Sets the given environment variable to the given value. Returns 0 on
success, or an errno on failure.