VLC 4.0.0-dev
Loading...
Searching...
No Matches

The functions in this file help with using low-level Unix-style file descriptors, BSD sockets and directories. More...

Include dependency graph for vlc_fs.h:

Go to the source code of this file.

Typedefs

typedef DIR vlc_DIR
 

Functions

int vlc_open (const char *filename, int flags,...)
 Opens a system file handle.
 
int vlc_openat (int dir, const char *filename, int flags,...)
 Opens a system file handle relative to an existing directory handle.
 
int vlc_mkstemp (char *)
 
int vlc_dup (int oldfd)
 Duplicates a file descriptor.
 
int vlc_dup2 (int oldfd, int newfd)
 Replaces a file descriptor.
 
int vlc_pipe (int[2])
 Creates a pipe (see "man pipe" for further reference).
 
int vlc_memfd (void)
 Creates an anonymous regular file descriptor, i.e.
 
ssize_t vlc_write (int, const void *, size_t)
 Writes data to a file descriptor.
 
ssize_t vlc_writev (int, const struct iovec *, int)
 Writes data from an iovec structure to a file descriptor.
 
int vlc_close (int fd)
 Closes a file descriptor.
 
int vlc_stat (const char *filename, struct stat *st)
 Finds file/inode information - like stat().
 
int vlc_lstat (const char *filename, struct stat *st)
 Finds file/inode information, as lstat().
 
int vlc_unlink (const char *filename)
 Removes a file.
 
int vlc_rename (const char *oldpath, const char *newpath)
 Moves a file atomically.
 
FILE * vlc_fopen (const char *filename, const char *mode)
 Opens a FILE pointer.
 
vlc_DIRvlc_opendir (const char *dirname)
 Opens a DIR pointer.
 
const char * vlc_readdir (vlc_DIR *dir)
 Reads the next file name from an open directory.
 
int vlc_loaddir (vlc_DIR *dir, char ***namelist, int(*select)(const char *), int(*compar)(const char **, const char **))
 Does the same as vlc_scandir(), but takes an open directory pointer instead of a directory path.
 
int vlc_scandir (const char *dirname, char ***namelist, int(*select)(const char *), int(*compar)(const char **, const char **))
 Selects file entries from a directory, as GNU C scandir().
 
void vlc_closedir (vlc_DIR *dir)
 
void vlc_rewinddir (vlc_DIR *dir)
 
int vlc_mkdir (const char *dirname, mode_t mode)
 Creates a directory.
 
int vlc_mkdir_parent (const char *dirname, mode_t mode)
 Creates a directory and parent directories as needed.
 
char * vlc_getcwd (void)
 Determines the current working directory.
 

Detailed Description

The functions in this file help with using low-level Unix-style file descriptors, BSD sockets and directories.

In general, they retain the prototype and most semantics from their respective standard equivalents. However, there are a few differences:

  • On Windows, file path arguments are expected in UTF-8 format. They are converted to UTF-16 internally, thus enabling access to paths outside of the local Windows ANSI code page.
  • On POSIX systems, file descriptors are created with the close-on-exec flag set (atomically where possible), so that they do not leak to child process after fork-and-exec.
  • vlc_scandir(), inspired by GNU scandir(), passes file names rather than dirent structure pointers to its callbacks.
  • vlc_accept() takes an extra boolean for nonblocking mode (compare with the flags parameter in POSIX.next accept4()).
  • Writing functions do not emit a SIGPIPE signal in case of broken pipe.