Impossible SDK

Reference

impossible/file.h

Files and folders, with UTF-8 paths.

Tier 0

im_result

What became of a file operation.

impossible/file.h, line 6
typedef enum im_result { IM_OK, IM_EXISTS, IM_MISSING, IM_TOO_LARGE, IM_FAILED } im_result;

im_read

The whole file in new memory, with a zero after it. Refuses more than most bytes.

impossible/file.h, line 9
im_result im_read(const char *path, size_t most, char **data, size_t *length);

im_write

Writes a file so that it is there complete or not at all. With replace false it makes the file once: whoever is second gets IM_EXISTS. The unique part names the temporary file and must differ between callers.

impossible/file.h, line 14
im_result im_write(const char *path, const void *data, size_t length, bool replace, const char *unique);

im_make_folder

Makes one folder; IM_OK too when it is there.

impossible/file.h, line 17
im_result im_make_folder(const char *path);

im_move

Moves a file or folder within a disk. Never replaces: IM_EXISTS when the new path is taken.

impossible/file.h, line 20
im_result im_move(const char *from, const char *to);

im_delete

Deletes a file, not a folder.

impossible/file.h, line 23
im_result im_delete(const char *path);

im_exists

Whether anything is at the path, file or folder.

impossible/file.h, line 26
bool im_exists(const char *path);

im_list

Calls each for every entry but . and .., until it gives false.

impossible/file.h, line 29
im_result im_list(const char *path, bool (*each)(void *user, const char *name, bool folder), void *user);

im_read_input

All of standard input; IM_TOO_LARGE above most bytes, and IM_FAILED when it cannot be read or there is no memory.

impossible/file.h, line 33
im_result im_read_input(size_t most, char **data, size_t *length);

im_now

Microseconds since 1970, UTC.

impossible/file.h, line 36
uint64_t im_now(void);
GeneratedMade from include/impossible/file.hPublished from b1dc570