Articles · Book · Estimator · CUPS 1.1 · CUPS 1.2 · CUPS 1.3 · CUPS 1.4 · CUPS 1.5 · Other CUPS · Search Help File and Directory APIsFile and Directory APIs
Contents
OverviewThe CUPS file and directory APIs provide portable interfaces
for manipulating files and listing files and directories. Unlike
stdio The FunctionsCUPS 1.2/Mac OS X 10.5 cupsDirCloseClose a directory.
void cupsDirClose ( Parameters
CUPS 1.2/Mac OS X 10.5 cupsDirOpenOpen a directory.
cups_dir_t *cupsDirOpen ( Parameters
Return ValueDirectory pointer or CUPS 1.2/Mac OS X 10.5 cupsDirReadRead the next directory entry.
cups_dentry_t *cupsDirRead ( Parameters
Return ValueDirectory entry or CUPS 1.2/Mac OS X 10.5 cupsDirRewindRewind to the start of the directory.
void cupsDirRewind ( Parameters
CUPS 1.2/Mac OS X 10.5 cupsFileCloseClose a CUPS file.
int cupsFileClose ( Parameters
Return Value0 on success, -1 on error CUPS 1.2/Mac OS X 10.5 cupsFileCompressionReturn whether a file is compressed.
int cupsFileCompression ( Parameters
Return Value
CUPS 1.2/Mac OS X 10.5 cupsFileEOFReturn the end-of-file status.
int cupsFileEOF ( Parameters
Return Value1 on end of file, 0 otherwise CUPS 1.2/Mac OS X 10.5 cupsFileFindFind a file using the specified path.
const char *cupsFileFind ( Parameters
Return ValueFull path to file or DiscussionThis function allows the paths in the path string to be separated by
colons (UNIX standard) or semicolons (Windows standard) and stores the
result in the buffer supplied. If the file cannot be found in any of
the supplied paths, CUPS 1.2/Mac OS X 10.5 cupsFileFlushFlush pending output.
int cupsFileFlush ( Parameters
Return Value0 on success, -1 on error CUPS 1.2/Mac OS X 10.5 cupsFileGetCharGet a single character from a file.
int cupsFileGetChar ( Parameters
Return ValueCharacter or -1 on end of file CUPS 1.2/Mac OS X 10.5 cupsFileGetConfGet a line from a configuration file.
char *cupsFileGetConf ( Parameters
Return ValueLine read or CUPS 1.2/Mac OS X 10.5 cupsFileGetLineGet a CR and/or LF-terminated line that may contain binary data.
size_t cupsFileGetLine ( Parameters
Return ValueNumber of bytes on line or 0 on end of file DiscussionThis function differs from CUPS 1.2/Mac OS X 10.5 cupsFileGetsGet a CR and/or LF-terminated line.
char *cupsFileGets ( Parameters
Return ValueLine read or CUPS 1.2/Mac OS X 10.5 cupsFileLockTemporarily lock access to a file.
int cupsFileLock ( Parameters
Return Value0 on success, -1 on error CUPS 1.2/Mac OS X 10.5 cupsFileNumberReturn the file descriptor associated with a CUPS file.
int cupsFileNumber ( Parameters
Return ValueFile descriptor CUPS 1.2/Mac OS X 10.5 cupsFileOpenOpen a CUPS file.
cups_file_t *cupsFileOpen ( Parameters
Return ValueCUPS file or DiscussionThe "mode" parameter can be "r" to read, "w" to write, overwriting any
existing file, "a" to append to an existing file or create a new file,
or "s" to open a socket connection. CUPS 1.2/Mac OS X 10.5 cupsFileOpenFdOpen a CUPS file using a file descriptor.
cups_file_t *cupsFileOpenFd ( Parameters
Return ValueCUPS file or DiscussionThe "mode" parameter can be "r" to read, "w" to write, "a" to append,
or "s" to treat the file descriptor as a bidirectional socket connection. CUPS 1.2/Mac OS X 10.5 cupsFilePeekCharPeek at the next character from a file.
int cupsFilePeekChar ( Parameters
Return ValueCharacter or -1 on end of file CUPS 1.2/Mac OS X 10.5 cupsFilePrintfWrite a formatted string.
int cupsFilePrintf ( Parameters
Return ValueNumber of bytes written or -1 on error CUPS 1.2/Mac OS X 10.5 cupsFilePutCharWrite a character.
int cupsFilePutChar ( Parameters
Return Value0 on success, -1 on error CUPS 1.4/Mac OS X 10.6 cupsFilePutConfWrite a configuration line.
ssize_t cupsFilePutConf ( Parameters
Return ValueNumber of bytes written or -1 on error DiscussionThis function handles any comment escaping of the value. CUPS 1.2/Mac OS X 10.5 cupsFilePutsWrite a string.
int cupsFilePuts ( Parameters
Return ValueNumber of bytes written or -1 on error DiscussionLike the CUPS 1.2/Mac OS X 10.5 cupsFileReadRead from a file.
ssize_t cupsFileRead ( Parameters
Return ValueNumber of bytes read or -1 on error CUPS 1.2/Mac OS X 10.5 cupsFileRewindSet the current file position to the beginning of the file.
off_t cupsFileRewind ( Parameters
Return ValueNew file position or -1 on error CUPS 1.2/Mac OS X 10.5 cupsFileSeekSeek in a file.
off_t cupsFileSeek ( Parameters
Return ValueNew file position or -1 on error CUPS 1.2/Mac OS X 10.5 cupsFileStderrReturn a CUPS file associated with stderr. cups_file_t *cupsFileStderr (void); Return ValueCUPS file CUPS 1.2/Mac OS X 10.5 cupsFileStdinReturn a CUPS file associated with stdin. cups_file_t *cupsFileStdin (void); Return ValueCUPS file CUPS 1.2/Mac OS X 10.5 cupsFileStdoutReturn a CUPS file associated with stdout. cups_file_t *cupsFileStdout (void); Return ValueCUPS file CUPS 1.2/Mac OS X 10.5 cupsFileTellReturn the current file position.
off_t cupsFileTell ( Parameters
Return ValueFile position CUPS 1.2/Mac OS X 10.5 cupsFileUnlockUnlock access to a file.
int cupsFileUnlock ( Parameters
Return Value0 on success, -1 on error CUPS 1.2/Mac OS X 10.5 cupsFileWriteWrite to a file.
ssize_t cupsFileWrite ( Parameters
Return ValueNumber of bytes written or -1 on error Data Typescups_dentry_tDirectory entry type typedef struct cups_dentry_s cups_dentry_t; cups_dir_tDirectory type typedef struct _cups_dir_s cups_dir_t; cups_file_tCUPS file type typedef struct _cups_file_s cups_file_t; Structurescups_dentry_sDirectory entry type struct cups_dentry_s { Members
| ||||||||||||||||
| Comments are owned by the poster. All other material is copyright 2007-2012 Apple Inc. All rights reserved. CUPS and the CUPS logo are trademarks of Apple Inc. All other trademarks are the property of their respective owners. Please report site problems to 'webmaster@cups.org'. |