![]() | ![]() | ![]() | Cuiterm Reference Manual | ![]() |
---|
#include <history.h> CuiFilename; CuiFilename* cui_filename_new (const char *file, const char *directory); gchar* cui_filename_get_filename (CuiFilename *file); gchar* cui_filename_get_canonical_filename (CuiFilename *file, gchar *working_directory); gchar* cui_filename_get_canonical_for_newname (CuiFilename *file, gchar *working_directory, gchar *newname); void cui_filename_set_mode_string (CuiFilename *filename, const gchar *mode_string); void cui_filename_set_mode_string_owner (CuiFilename *filename, const gchar *string); void cui_filename_set_mode_string_group (CuiFilename *filename, const gchar *string); void cui_filename_set_mode_string_others (CuiFilename *filename, const gchar *string); void cui_filename_set_owner (CuiFilename *filename, const gchar *owner); gchar* cui_filename_get_owner (CuiFilename *file); void cui_filename_set_group (CuiFilename *filename, const gchar *group); gchar* cui_filename_get_group (CuiFilename *file); void cui_filename_set_owner_and_group (CuiFilename *filename, const gchar *owner, const gchar *group); enum CuiFileType; gboolean cui_filename_is_compressed (CuiFilename *filename); CuiFileType cui_filename_get_filetype (CuiFilename *filename); const gchar* cui_filename_get_typename (CuiFilename *filename); gboolean cui_filename_is_dir (CuiFilename *filename); gboolean cui_filename_is_block_device (CuiFilename *filename); gboolean cui_filename_is_character_device (CuiFilename *filename); gboolean cui_filename_is_user_read (CuiFilename *filename); gboolean cui_filename_is_user_write (CuiFilename *filename); gboolean cui_filename_is_user_execute (CuiFilename *filename); gboolean cui_filename_is_group_read (CuiFilename *filename); gboolean cui_filename_is_group_write (CuiFilename *filename); gboolean cui_filename_is_group_execute (CuiFilename *filename); gboolean cui_filename_is_others_read (CuiFilename *filename); gboolean cui_filename_is_others_write (CuiFilename *filename); gboolean cui_filename_is_others_execute (CuiFilename *filename); void cui_filename_set_filetype_dir (CuiFilename *filename); void cui_filename_set_filetype_regular (CuiFilename *filename); void cui_filename_set_filetype_link (CuiFilename *filename); gchar* cui_filename_get_editor (CuiFilename *filename, gchar *long_name); gchar* cui_filename_get_viewer (CuiFilename *filename, gchar *long_name); gchar* cui_filename_get_processor (CuiFilename *filename, gchar *long_name); CuiFileSizeChange cui_filename_get_size_change (CuiFilename *filename); GType cui_filename_get_type (void); void cui_filename_set_file_size (CuiFilename *filename, gint64 size); void cui_filename_set_filetype_block (CuiFilename *filename);
"directory" gchararray : Read / Write "filename" gchararray : Read / Write "group" gchararray : Read / Write "inode-modified" gpointer : Read / Write "last-modified" gpointer : Read / Write "last-used" gpointer : Read / Write "mode-string" gchararray : Read / Write "owner" gchararray : Read / Write "size" gint64 : Read / Write
CuiFilename* cui_filename_new (const char *file, const char *directory);
Creates a new CuiFilename which holds infomation about files and directories.
The function will unquote the filename with the g_shell_unquote function of the G library.
file : | the basename of the file |
directory : | the path of the directory holds this file |
Returns : | a new CuiFilename object |
gchar* cui_filename_get_filename (CuiFilename *file);
Returns the basename of the file. The return value is a newly allocated memory should be freed by the caller.
file : | |
Returns : | the basename of this file |
gchar* cui_filename_get_canonical_filename (CuiFilename *file, gchar *working_directory);
Returns the simplest usable name for the file. The return value is newly allocated should be freed by the caller.
file : | |
working_directory : | the current working directory |
Returns : | the basename of this file |
gchar* cui_filename_get_canonical_for_newname (CuiFilename *file, gchar *working_directory, gchar *newname);
Returns what will be the canonical name of the given file if we change its name to the new name. This file is used when generating commands like mv, shich must be used like this:
mv ~/directory/filename ~/directory/newfilename
The function returns a newly allocated string which should be freed.
file : | a CuiFilename: |
working_directory : | the current working directory |
newname : | the new name of the file |
Returns : | the shortest usable new name for the file |
void cui_filename_set_mode_string (CuiFilename *filename, const gchar *mode_string);
Sets the mode bits stored for this file by disassembling the mode string. The mode string is looks like this: 'drwxr-----' as the ls program used to print when the -l option is in use.
filename : | |
mode_string : | the mode string (first column of the output of 'ls -l') |
void cui_filename_set_mode_string_owner (CuiFilename *filename, const gchar *string);
Sets the mode bits stored for this file by disassembling the mode string. This function will change the stored mode string if it is already set.
filename : | |
string : | the owner rights in the mode string (eg. "rwx") |
void cui_filename_set_mode_string_group (CuiFilename *filename, const gchar *string);
Sets the mode bits stored for this file by disassembling the mode string. This function will change the stored mode string if it is already set.
filename : | |
string : | the group rights in the mode string (eg. "rwx") |
void cui_filename_set_mode_string_others (CuiFilename *filename, const gchar *string);
Sets the mode bits stored for this file by disassembling the mode string. This function will change the stored mode string if it is already set.
filename : | |
string : | the others rights in the mode string (eg. "rwx") |
void cui_filename_set_owner (CuiFilename *filename, const gchar *owner);
Sets the file owner's name for the filename.
filename : | |
owner : | the user name of the owner |
gchar* cui_filename_get_owner (CuiFilename *file);
file : | |
Returns : | the name of the owner of this file |
void cui_filename_set_group (CuiFilename *filename, const gchar *group);
Sets the group owner's name for the filename.
filename : | |
group : | the group name |
gchar* cui_filename_get_group (CuiFilename *file);
file : | |
Returns : | the name of the group owner of this file |
void cui_filename_set_owner_and_group (CuiFilename *filename, const gchar *owner, const gchar *group);
Sets the name of the file owner and group owner for the filename.
filename : | |
owner : | the user name of the owner |
group : | the group name |
typedef enum { FILETYPE_UNKNOWN, FILETYPE_FILE, FILETYPE_DIRECTORY, FILETYPE_BLOCK, FILETYPE_CHAR, FILETYPE_FIFO, FILETYPE_LINK, FILETYPE_SOCKET } CuiFileType;
gboolean cui_filename_is_compressed (CuiFilename *filename);
Returns TRUE if the file is a compressed file. We return FALSE for a tar archive (if not compressed) since the user may want to compress these files with some other program.
filename : | |
Returns : | TRUE if the file is compressed |
CuiFileType cui_filename_get_filetype (CuiFilename *filename);
Returns the type of the file (such as regular file, directory, block special file, etc.).
filename : | a Filename object pointer |
Returns : | the type of the file |
const gchar* cui_filename_get_typename (CuiFilename *filename);
Returns the type of the file as a string (such as "regular file", "directory", "block special file", etc.). The string should not modified oor freed.
filename : | a Filename object pointer |
Returns : | the type of the file |
gboolean cui_filename_is_dir (CuiFilename *filename);
filename : | |
Returns : | TRUE if the given file is a directory type entry. |
gboolean cui_filename_is_block_device (CuiFilename *filename);
filename : | |
Returns : | TRUE if the given file is a block device. |
gboolean cui_filename_is_character_device (CuiFilename *filename);
filename : | |
Returns : | TRUE if the given file is a character device. |
gboolean cui_filename_is_user_read (CuiFilename *filename);
filename : | |
Returns : | TRUE if the user has the right to read the file. |
gboolean cui_filename_is_user_write (CuiFilename *filename);
filename : | |
Returns : | TRUE if the user has the right to write the file. |
gboolean cui_filename_is_user_execute (CuiFilename *filename);
filename : | |
Returns : | TRUE if the user has the right to execute the file. |
gboolean cui_filename_is_group_read (CuiFilename *filename);
filename : | |
Returns : | TRUE if the group has the right to read the file. |
gboolean cui_filename_is_group_write (CuiFilename *filename);
filename : | |
Returns : | TRUE if the group has the right to write the file. |
gboolean cui_filename_is_group_execute (CuiFilename *filename);
filename : | |
Returns : | TRUE if the group has the right to execute the file. |
gboolean cui_filename_is_others_read (CuiFilename *filename);
filename : | |
Returns : | TRUE if the others has the right to read the file. |
gboolean cui_filename_is_others_write (CuiFilename *filename);
filename : | |
Returns : | TRUE if the others has the right to write the file. |
gboolean cui_filename_is_others_execute (CuiFilename *filename);
filename : | |
Returns : | TRUE if the others has the right to execute the file. |
void cui_filename_set_filetype_dir (CuiFilename *filename);
Sets the type of the filename to directory type entry.
filename : |
void cui_filename_set_filetype_regular (CuiFilename *filename);
Sets the type of the filename to regular file.
filename : |
void cui_filename_set_filetype_link (CuiFilename *filename);
Sets the type of the filename to soft link.
filename : |
gchar* cui_filename_get_editor (CuiFilename *filename, gchar *long_name);
Returns a command line string which can be used to open an editor (not a
viewer) for the given file. The string is in a newly allocated memory area
which must be freed with the g_free()
function.
filename : | |
long_name : | the full name of file used in the command |
Returns : | a command which will start up an editor program for this file |
gchar* cui_filename_get_viewer (CuiFilename *filename, gchar *long_name);
Returns a command line string which can be used to open a viewer (not an
editor) for the given file. The string is in a newly allocated memory area
which must be freed with the g_free()
function.
filename : | |
long_name : | the full name of file used in the command |
Returns : | a command which will start up a viewer program for this file |
gchar* cui_filename_get_processor (CuiFilename *filename, gchar *long_name);
Returns a command line string which can be used to open a processor (not a
viewer) for the given file. The string is in a newly allocated memory area
which must be freed with the g_free()
function.
filename : | |
long_name : | the full name of file used in the command |
Returns : | a command which will start up a processor program for this file |
CuiFileSizeChange cui_filename_get_size_change (CuiFilename *filename);
filename : | |
Returns : |
|
void cui_filename_set_file_size (CuiFilename *filename, gint64 size);
filename : | |
size : |
|
void cui_filename_set_filetype_block (CuiFilename *filename);
Sets the type of the filename to block device type entry.
filename : |
"directory" gchararray : Read / Write
The directory in which we found the file.
Default value: ""
"filename" gchararray : Read / Write
The basename of the file.
Default value: ""
"group" gchararray : Read / Write
The name of the file group owner.
Default value: ""
"inode-modified" gpointer : Read / Write
The time the file inode last used.
"last-modified" gpointer : Read / Write
The time the file last modified.
"mode-string" gchararray : Read / Write
The mode string as the '-l' option of the 'ls' used to write.
Default value: ""
"owner" gchararray : Read / Write
The user name of the file owner.
Default value: ""
<<< CuiUserMenu | CuiIcon >>> |