Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
io.h File Reference
#include "zrythm-config.h"
#include <stdbool.h>
#include <stdio.h>
#include <glib.h>
Include dependency graph for io.h:

Go to the source code of this file.

Macros

#define io_path_get_basename(filename)   g_path_get_basename (filename)
 
#define io_get_files_in_dir(dir, allow_empty)    io_get_files_in_dir_ending_in (dir, 0, NULL, allow_empty)
 Returns a list of the files in the given directory.
 
#define io_write_file   g_file_set_contents
 

Functions

NONNULL char * io_get_dir (const char *filename)
 Gets directory part of filename.
 
WARN_UNUSED_RESULT NONNULL_ARGS (1) bool io_mkdir(const char *dir
 Makes directory if doesn't exist.
 
NONNULL FILE * io_create_file (const char *filename)
 Creates the file if doesn't exist.
 
void io_touch_file (const char *filename)
 Touches a file similar to UNIX touch.
 
NONNULL char * io_path_get_parent_dir (const char *path)
 
NONNULL char * io_file_strip_ext (const char *filename)
 Strips extensions from given filename.
 
NONNULL const char * io_file_get_ext (const char *file)
 Returns file extension or NULL.
 
NONNULL char * io_path_get_basename_without_ext (const char *filename)
 Strips path from given filename.
 
NONNULL char * io_file_get_creation_datetime (const char *filename)
 
NONNULL gint64 io_file_get_last_modified_datetime (const char *filename)
 Returns the number of seconds since the epoch, or -1 if failed.
 
NONNULL char * io_file_get_last_modified_datetime_as_str (const char *filename)
 
NONNULL int io_remove (const char *path)
 Removes the given file.
 
NONNULL int io_rmdir (const char *path, bool force)
 Removes a dir, optionally forcing deletion.
 
char ** io_get_files_in_dir_as_basenames (const char *dir, bool allow_empty, bool with_ext)
 
char ** io_get_files_in_dir_ending_in (const char *_dir, const int recursive, const char *end_string, bool allow_empty)
 Returns a list of the files in the given directory.
 
WARN_UNUSED_RESULT bool io_copy_dir (const char *destdir_str, const char *srcdir_str, bool follow_symlinks, bool recursive, GError **error)
 Copies a directory.
 
NONNULL char * io_get_next_available_filepath (const char *filepath)
 Returns a newly allocated path that is either a copy of the original path if the path does not exist, or the original path appended with (n), where n is a number.
 
NONNULL void io_open_directory (const char *path)
 Opens the given directory using the default program.
 
NONNULL void io_escape_dir_name (char *dest, const char *dir)
 Returns a clone of the given string after removing forbidden characters.
 
NONNULL char * io_traverse_path (const char *abs_path)
 Returns the new path after traversing any symlinks (using readlink()).
 

Variables

WARN_UNUSED_RESULT GError ** error