7 #ifndef EXT_FILESYSTEM_UTILS_H_
8 #define EXT_FILESYSTEM_UTILS_H_
14 #define buffer_length 1024
23 int buffered_write(
char** buffer,
size_t* buffer_size,
char* data,
size_t size);
32 int read_while(
int fd,
char* buffer,
size_t to_read);
41 int write_while(
int fd,
const char* buffer,
size_t to_write);
51 char* parse_path(
const char* path,
char* current_file_name);
61 bool split_path(
const char* path,
char* parent_path,
char* dirname);
87 #endif //EXT_FILESYSTEM_UTILS_H_
int read_while(int fd, char *buffer, size_t to_read)
Properly reading from memory.
int write_while(int fd, const char *buffer, size_t to_write)
Properly writing to memory.
char * parse_command(char *command_buffer, char *command)
Parse command Parse command to command and args. Put command to arg command and return position of fi...
ssize_t get_file_size(const char *path_to_file)
Get size of file.
void read_command_from_stdin(char *command_buffer, size_t buffer_size)
Read line from stdin.
int buffered_write(char **buffer, size_t *buffer_size, char *data, size_t size)