cuos/fs.h: File System
[cuos: Interface to the Operating System]

Enumerations

enum  cuos_dentry_type_t {
  cuos_dentry_type_none, cuos_dentry_type_file, cuos_dentry_type_dir, cuos_dentry_type_char_dev,
  cuos_dentry_type_block_dev, cuos_dentry_type_fifo, cuos_dentry_type_symlink, cuos_dentry_type_socket,
  cuos_dentry_type_unknown
}

Functions

cuos_dentry_type_t cuos_dentry_type (cu_str_t path)
cu_bool_t cuos_have_dentry (cu_str_t path)
cu_bool_t cuos_have_dir (cu_str_t path)
cu_bool_t cuos_have_file (cu_str_t path)
cu_bool_t cuos_have_link (cu_str_t path)
time_t cuos_mtime (cu_str_t path)
cu_bool_t cuos_mkdir_rec (cu_str_t path, mode_t mode)
cu_bool_t cuos_remove_rec (cu_str_t path)
cu_bool_t cuos_dirrec_conj_files (cu_str_t dname, cu_clop(cb, cu_bool_t, cu_str_t))
cu_bool_t cuos_dirreccoll_conj_files (cu_str_t dname, cu_clop(cb, cu_bool_t, cu_str_t))
cu_bool_t cuos_prefixsearch_conj (cucon_list_t prefixlist, cu_str_t suffix, cu_clop(cb, cu_bool_t, cu_str_t result))
cu_str_t cuos_prefixsearch_first (cucon_list_t prefixlist, cu_str_t suffix)
void cuos_prefixsearch_append_all (cucon_list_t prefixlist, cu_str_t suffix, cucon_list_t result)
cu_str_t cuos_tmp_dir (void)
cu_str_t cuos_session_dir (mode_t mode)

Detailed Description

These functions probes or manipulates the file system and related metadata.

See also:
cuos_path_h "cuos/path.h" for manipulating file paths.
cuos/file.h: Functions on Files "cuos/file.h" for accessing regular files.

Enumeration Type Documentation

Catogorisation of files, directories, special files.

Enumerator:
cuos_dentry_type_none 

a null value

cuos_dentry_type_file 

a normal file

cuos_dentry_type_dir 

a directory

cuos_dentry_type_char_dev 

a character device special file

cuos_dentry_type_block_dev 

a block device special file

cuos_dentry_type_fifo 

a first-in first-out pipe

cuos_dentry_type_symlink 

a symbolic link

cuos_dentry_type_socket 

a socket special file

cuos_dentry_type_unknown 

undetectable or unknown file type


Function Documentation

cuos_dentry_type_t cuos_dentry_type ( cu_str_t  path  ) 

The directory entry type of path as on the file system.

cu_bool_t cuos_dirrec_conj_files ( cu_str_t  dname,
cu_clop(cb, cu_bool_t, cu_str_t  
)

Run

 cu_call(cb, path)

on each path which is dname or a subdirectory or file under dname, using depth-first with no specific ordering within each directory.

cu_bool_t cuos_dirreccoll_conj_files ( cu_str_t  dname,
cu_clop(cb, cu_bool_t, cu_str_t  
)

Run

 cu_call(cb, path)

on each path which is dname or a subdirectory or file under dname, using a depth-first with collating order of file names within each directory.

cu_bool_t cuos_have_dentry ( cu_str_t  path  ) 

True iff path names a detectable directory entry on the local file system, and it is not a broken symbolic link.

cu_bool_t cuos_have_dir ( cu_str_t  path  ) 

True iff path names a detectable directory or link to such on the local file system.

cu_bool_t cuos_have_file ( cu_str_t  path  ) 

True iff path names a detectable regular file or link to such on the local file system.

cu_bool_t cuos_have_link ( cu_str_t  path  ) 

True iff path names a detectable symbolic link on the local file system. Returns true also for broken symbolic links.

cu_bool_t cuos_mkdir_rec ( cu_str_t  path,
mode_t  mode 
)

Create all missing components of path and path itself as a directory.

time_t cuos_mtime ( cu_str_t  path  ) 

Return the modification time of path, or 0 if path does not exist. On other errors, write an error message and return 0.

void cuos_prefixsearch_append_all ( cucon_list_t  prefixlist,
cu_str_t  suffix,
cucon_list_t  result 
)
cu_bool_t cuos_prefixsearch_conj ( cucon_list_t  prefixlist,
cu_str_t  suffix,
cu_clop(cb, cu_bool_t, cu_str_t result)   
)
cu_str_t cuos_prefixsearch_first ( cucon_list_t  prefixlist,
cu_str_t  suffix 
)
cu_bool_t cuos_remove_rec ( cu_str_t  path  ) 

Removes path, and if it is a directory, descends and removes all files and subdirectories recursively.

Warning:
This may wipe out all your files if used carelessly. Make sure you carefully control the argument passed to this function.
cu_str_t cuos_session_dir ( mode_t  mode  ) 

A directory to load and store the state of an interactive application. Before using this function, you must set the application name, e.g. by calling cu_set_application_name. The session directory will typically be $HOME/.appname. If mode is zero and the directory does not exist, NULL is returned. If mode is non-zero and the directory does not exist, the directory will be created with that mode (permissions).

cu_str_t cuos_tmp_dir ( void   ) 

Returns a temporary directory for the current process, which will be erased at exit.

Generated 2009-11-23 for culibs-0.25 using Doxygen. Maintained by Petter Urkedal.