File system hooks
ALLEGRO_FS_ENTRY
Opaque filesystem entry object. Represents a file or a directory (check with al_is_directory or al_is_file). There are no user accessible member variables. EnumerationsALLEGRO_FS_FILTER
File system search filters. Type Filters:
Permission Filters:
Access Filters:
Other Filters:
ALLEGRO_FS_MKTEMP_UNLINK
al_fs_mktemp unlink modes
ALLEGRO_FS_MODE
Filesystem modes/types
ALLEGRO_FS_SORT
Filesystem search sort flags
XXX do we need ALLEGRO_FS_SORT_TYPE? It sounds like we don't even know what it should do. ALLEGRO_SEEK
Search Path Routinesal_add_search_path
Adds a path to the list of directories to search for files when searching/opening files with a relative pathname. al_get_search_path
Fills in 'dest' up to 'len' bytes with the 'idx'th search path item. Parameters: idx - index of search path element requested dest - memory buffer to copy path to len - length of memory buffer Returns true on success, and false on failure. errno is set to indicate the error. Possible Errors: * EINVAL - invalid item selected * ERANGE - buffer not large enough See also: al_get_errno al_search_path_count
Returns the number of items in the search path list. File Manipulational_create_entry
Creates an ALLEGRO_FS_ENTRY object pointing to path. 'path' can be a file or a directory and must not be NULL. al_destroy_entry
Destroys a fs entry handle. Closes file if it was open. al_close_entry
Closes fs entry. al_closedir
Closes a previously opened directory entry object. al_close_entry is also a valid way to close any entry object. Does not free the entry object if it was opened with al_opendir. XXX This is probably a bug. Returns true on succes, false on failure and fills in errno to indicate the error. al_mkdir
Creates a new directory on disk given the path 'path'. Returns false on error and fills in errno to indicate the error. See also: al_get_errno al_mktemp
Make a temporary randomly named file given a filename 'template' and 'ulink' flags. 'template' is a string giving the format of the generated filename and should include one or more capital Xs. The Xs are replaced with random alphanumeric chars. 'ulink' is one of:
al_open_entry
Opens handle with mode 'mode'. mode is a stdio type mode, ie: "r", "w", etc Returns true on success, false on failure and fills in errno to indicate the error. See also: al_get_errno al_opendir
Creates and opens a filesystem entry object for a directory. Returns NULL on error. al_readdir
Reads the next dir item name into 'name' buffer, up to 'size' chars. Warning: this may leave the filename truncated. XXX and how do users know if that's the case? Returns non zero on error. al_unlink_entry
"Unlink" or delete this file on disk. Returns true on success, and false on failure, error is indicated in errno. al_unlink_str
Unlink 'path' entry from disk. Returns true on success, and false on failure. errno is filled in to indicate the error. See Also: al_unlink_entry al_fstat
Updates stat info for entry 'fp'. Returns true on success, false on failure. Fills in errno to indicate the error. See also al_get_errno al_get_entry_ctime al_is_file File Propertiesal_is_present
Check if the given entry exists on disk. Returns true if it does exist or false if it doesn't exist, or an error occured. Error is indicated in errno. al_is_present_str
Check if entry 'path' exists on disk. See Also: al_is_present al_is_file
Return true iff this entry is a regular file. al_is_file_str
Return true if 'path' is a file. See Also: al_is_file al_is_directory
Return true iff this entry is a directory. al_is_directory_str
Return true if 'path' is a directory. See Also: al_is_directory al_get_entry_mode
Returns the entry's mode flags. See also: al_get_errno See the ALLEGRO_FS_MODE enum for valid flags. al_get_entry_mode_str
Returns stat 'mode' for fs entry 'path'. See Also: ALLEGRO_FS_MODE al_get_entry_atime
Returns the time in seonds since the epoch since the entry was last accessed. Warning: some filesystem either don't support this flag, or people turn it off to increase performance. It may not be valid in all circumstances. al_get_entry_atime_str
Returns last access time for fs entry 'path'. See Also: al_get_entry_atime al_get_entry_ctime
Returns the time in seconds since the epoch this entry was created on the filsystem. al_get_entry_ctime_str
Returns creation time for fs entry 'path'. See Also: al_get_entry_ctime al_get_entry_mtime
Returns the time in seconds since the epoch since the entry was last modified. al_get_entry_mtime_str
Returns last modification time for fs entry 'path'. See Also: al_get_entry_mtime al_get_entry_name
Fills in buf up to size bytes including trailing NULL char with the entry's name Returns true on success, and false on error. errno is set to indicate the error. If buf isn't large enough, errno will be set to ERANGE al_get_entry_size
Returns the size, in bytes, of the given entry. al_get_entry_size_str
Returns file size for fs entry 'path'. See Also: al_get_entry_size File I/Oal_fopen
Creates and opens an ALLEGRO_FS_ENTRY object given path and mode. 'path' - the path to open 'mode' - mode to open the entry in ("r", "w", etc.) al_fclose
Closes the given file entry object. Will destroy the handle if it was opened with al_fopen. If you do not wish the entry object destroyed, use al_close_entry instead. al_feof
Returns true if we have an end of file condition. al_ferror
Returns true if there was some sort of previous error. al_fgets
Reads a string of bytes terminated with a newline (\r,\n,\r\n). Parameters:
Returns: p al_fputs
Writes a string to file. Parameters:
Returns: 0 on success or -1 on error Note: Function converts string to UTF8 before writing. al_fflush
Flush any pending writes to 'fp' to disk. Returns true on success, false otherwise, and errno is set to indicate the error. See also: al_get_errno al_fgetc
Read and return next byte in entry 'f'. Returns EOF on end of file, and 0 on other errors (XXX this is probably a bug) al_fputc
Write a single byte to entry. Parameters: c - byte value to write f - entry to write to Returns: EOF on error al_fungetc
Ungets a single byte from a file. Does not write to file, it only places the char back into the entry's buffer. See also al_get_errno al_fread32le
Reads a 32-bit word in little-endian format (LSB first). Returns: The read 32-bit word or EOF on error. al_fwrite32le
Writes a 32-bit word in little-endian format (LSB first). Returns: The written 32-bit word or EOF on error. al_fread16le
Reads a 16-bit word in little-endian format (LSB first). Returns: The read 16-bit word or EOF on error al_fwrite16le
Writes a 16-bit word in little-endian format (LSB first). Returns: The written 16-bit word or EOF on error. al_fread32be
Read a 32-bit word in big-endian format (MSB first). Returns: The read 32-bit word or EOF on error al_fwrite32be
Writes a 32-bit word in big-endian format (MSB first). Returns: The written 32-bit word or EOF on error. al_fread16be
Reads a 16-bit word in big-endian format (MSB first). Returns: The read 16-bit word or EOF on error. al_fwrite16be
Writes a 16-bit word in big-endian format (MSB first). Returns: The written 16-bit word or EOF on error al_fread
Read 'size' bytes into 'ptr' from entry 'fp' Return number of bytes actually read. al_fwrite
Write 'size' bytes from 'ptr' into file 'fp' Return number of bytes actually written or 0 on error. Does not distinguish between EOF and other errors. Use al_feof and al_ferror to tell them apart. al_fseek
Seek to 'offset' in file based on 'whence'. 'whence' can be:
Returns true on success, false on failure and errno is set to indicate the error. On some platforms this function may not support large files. See also: al_get_errno al_ftell
Returns the current position in file, or -1 on error. errno is set to indicate the error. On some platforms this function may not support large files. See also: al_get_errno Otheral_getcwd
Fill in 'buf' up to 'len' characters with the current working directory. Returns true on success, false on failure. errno is filled in to indicate the error. Possible Errors: * ERANGE - buffer is not large enough See also: al_get_errno al_chdir
Changes the current working directory to 'path'. Returns -1 on error. al_path_to_sys
Converts path 'orig' to system dependant format. XXX return code? al_path_to_uni
Converts path 'orig' to 'allegro' format. XXX return code? al_path_sep
Fills in 'sep' up to 'len' characters with the path separator string. XXX return code? al_drive_sep
Fills in 'sep' up to 'len' characters with the drive separator string. XXX return code? |
Last updated: 2009-02-09 09:20:17Z