|
|
|
|
@ -1114,78 +1114,56 @@ double yon_size_long_convert_to_mod(double size, char mod);
|
|
|
|
|
|
|
|
|
|
double yon_size_long_convert_automatic(unsigned long bytes, char *size);
|
|
|
|
|
|
|
|
|
|
/**yon_file_path_proceed_spaces(char *path)
|
|
|
|
|
* [EN]
|
|
|
|
|
*
|
|
|
|
|
* [RU]
|
|
|
|
|
* Оборачивает все пробелы в пути для правильной обработки
|
|
|
|
|
*/
|
|
|
|
|
/// @brief Wrap all spaces in paths for proper handling in commands
|
|
|
|
|
/// @return A newly allocated string or NULL if path was empty.
|
|
|
|
|
char *yon_file_path_proceed_spaces(char *path);
|
|
|
|
|
|
|
|
|
|
/**yon_file_open(char *file_path, int *size)
|
|
|
|
|
* [EN]
|
|
|
|
|
*
|
|
|
|
|
* [RU]
|
|
|
|
|
* Открывает файл [file_path], возвращает содержимое в виде массива строк размера [size]
|
|
|
|
|
*/
|
|
|
|
|
/// @brief Read file and return its contents as string array, separated by new line symbols.
|
|
|
|
|
/// @param file_path Path to file.
|
|
|
|
|
/// @param size Size of returned list.
|
|
|
|
|
/// @return A newly allocated array of strings containing the entire contents of the file.
|
|
|
|
|
config_str yon_file_open(char *file_path, int *size);
|
|
|
|
|
|
|
|
|
|
/**yon_file_save(char *file_path, char *text)
|
|
|
|
|
* [EN]
|
|
|
|
|
*
|
|
|
|
|
* [RU]
|
|
|
|
|
* Сохранить текст [text] в файл по пути [file_path]. Если файла не существует, он создаётся
|
|
|
|
|
*/
|
|
|
|
|
/// @brief Save string to file
|
|
|
|
|
/// @param file_path File where text will be saved.
|
|
|
|
|
/// @param text Text to save.
|
|
|
|
|
/// @return TRUE if successful, FALSE otherwise
|
|
|
|
|
int yon_file_save(char *file_path, char *text);
|
|
|
|
|
|
|
|
|
|
/**yon_file_create(char *path, char *name, int rules)
|
|
|
|
|
* [EN]
|
|
|
|
|
*
|
|
|
|
|
* [RU]
|
|
|
|
|
* Создать файл с названием [name], находящимся по пути [path]
|
|
|
|
|
* С правами доступа [rules] (от 0000 до 0777)
|
|
|
|
|
*/
|
|
|
|
|
/// @brief Create a file for path.
|
|
|
|
|
/// @param path Path to create file.
|
|
|
|
|
/// @param name File name.
|
|
|
|
|
/// @param rules Rules for all created directories and file (from 0000 to 0777).
|
|
|
|
|
/// @return TRUE if file were successfully created, FALSE if file exist/invalid path/error occured while creating file.
|
|
|
|
|
int yon_file_create(char *path, char *name, int rules);
|
|
|
|
|
|
|
|
|
|
/**yon_file_create_full_path(char *path, char *name, int rules)
|
|
|
|
|
* [EN]
|
|
|
|
|
*
|
|
|
|
|
* [RU]
|
|
|
|
|
* Создать файл по пути [path]
|
|
|
|
|
* С правами доступа [rules] (от 0000 до 0777)
|
|
|
|
|
*/
|
|
|
|
|
/// @brief Create a file and any missing directories for path.
|
|
|
|
|
/// @param rules Rules for all created directories and file (from 0000 to 0777).
|
|
|
|
|
/// @return TRUE if file were successfully created, FALSE if file exist/invalid path/error occured while creating file.
|
|
|
|
|
int yon_file_create_full_path(char *path, mode_t rules);
|
|
|
|
|
|
|
|
|
|
/**yon_file_ls (char *path, int *size)
|
|
|
|
|
* [EN]
|
|
|
|
|
*
|
|
|
|
|
* [RU]
|
|
|
|
|
* Возвращает массив названий директорий размера [size], находящихся внутри директории [path].
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/// @brief Get a list of directory names for path.
|
|
|
|
|
/// @param size Size of returned list.
|
|
|
|
|
/// @return A newly allocated string array or NULL.
|
|
|
|
|
config_str yon_file_list_dirs (char *path, int *size);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* [EN]
|
|
|
|
|
*
|
|
|
|
|
* [RU]
|
|
|
|
|
* Возвращает массив строк размера [size] с именами всех файлов и папок из директории [path]
|
|
|
|
|
*/
|
|
|
|
|
/// @brief Get a list of file/directory names for path.
|
|
|
|
|
/// @param path Path string.
|
|
|
|
|
/// @param size Size of returned list.
|
|
|
|
|
/// @return A newly allocated string array or NULL.
|
|
|
|
|
config_str yon_file_ls(char *path, int *size);
|
|
|
|
|
|
|
|
|
|
/**yon_file_is_directory(const char *path)
|
|
|
|
|
* [EN]
|
|
|
|
|
*
|
|
|
|
|
* [RU]
|
|
|
|
|
* Проверяет указывает ли путь [path] на директорию
|
|
|
|
|
*/
|
|
|
|
|
/// @brief Get parent directory from path.
|
|
|
|
|
/// @return Newly allocated string with parent path or NULL.
|
|
|
|
|
char *yon_file_get_parent(const char *path);
|
|
|
|
|
|
|
|
|
|
/// @brief Check if path points to directory.
|
|
|
|
|
/// @return TRUE if path is pointing to directory, 0 otherwise.
|
|
|
|
|
int yon_file_is_directory(const char *path);
|
|
|
|
|
|
|
|
|
|
/**yon_dir_remove(const char *path)
|
|
|
|
|
* [EN]
|
|
|
|
|
*
|
|
|
|
|
* [RU]
|
|
|
|
|
* Проверяет указывает ли путь [path] на директорию и удаляет её
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/// @brief Removes directory for path. If path is not directory, nothing happens.
|
|
|
|
|
void yon_dir_remove(const char *path);
|
|
|
|
|
|
|
|
|
|
/** yon_dir_get_contents(char *dir_path, int *size)
|
|
|
|
|
@ -1196,7 +1174,7 @@ void yon_dir_remove(const char *path);
|
|
|
|
|
* возвращает список всех вложенных файлов и папок,
|
|
|
|
|
* передавая в [size] длину списка.
|
|
|
|
|
*/
|
|
|
|
|
config_str yon_dir_get_contents(char *dir_path, int *size);
|
|
|
|
|
__attribute__((deprecated("Use yon_file_ls() instead"))) config_str yon_dir_get_contents(char *dir_path, int *size);
|
|
|
|
|
|
|
|
|
|
config_str yon_dir_get_by_mask(char *path, char *mask, int *size);
|
|
|
|
|
|
|
|
|
|
|