Reference
impossible/file.h
Files and folders, with UTF-8 paths.
Tier 0
im_result
What became of a file operation.
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.
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.
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.
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.
im_result im_move(const char *from, const char *to);im_delete
Deletes a file, not a folder.
im_result im_delete(const char *path);im_exists
Whether anything is at the path, file or folder.
bool im_exists(const char *path);im_list
Calls each for every entry but . and .., until it gives false.
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.
im_result im_read_input(size_t most, char **data, size_t *length);im_now
Microseconds since 1970, UTC.
uint64_t im_now(void);include/impossible/file.hPublished from b1dc570