⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qccfileopen.3

📁 spiht for linux this is used to decod and encode vedio i wich all enjoy
💻 3
字号:
.TH QCCFILEOPEN 3 "QCCPACK" "".SH NAMEQccFileExists,QccFileOpen,QccFileDescriptorOpen,QccFileClose,QccFileRemove,QccFileGetSize,QccFileGetModTime,QccFileGetCurrentPosition\- file-access routines.SH SYNOPSIS.B #include "libQccPack.h".sp.BI "int QccFileExists(const QccString " filename );.br.BI "int QccFileGetExtension(const QccString " filename ", QccString " extension );.br.BI "FILE *QccFileOpen(const QccString " filename ", QccString " mode );.br.BI "FILE *QccFileDescriptorOpen(int " file_descriptor ", const QccString " mode );.br.BI "int QccFileClose(FILE *" fileptr );.br.BI "int QccFileSeekable(FILE *" fileptr );.br.BI "int QccFileFlush(FILE *" fileptr );.br.BI "int QccFileRemove(const QccString " filename );.br.BI "int QccFileGetSize(const QccString " filename ", FILE *" fileptr ", long *" filesize );.br.BI "int QccFileGetModTime(const QccString " filename ", FILE *" fileptr ", long *" time );.br.BI "int QccFileGetCurrentPosition(FILE *" infile ", long *" current_position );.SH DESCRIPTION.B QccFileExists()returns 1 if the file specified by.I filenameexists, or 0 otherwise..LP.BR QccFileGetExtension()examines.I filenameand returns in.I extensionthe filename extension, the substring of.I filenameappearing after the final '.'.If.I filenamehas no '.' in it, then.BR QccFileGetExtension()returns with a raturn value of 1 and a zero-length string in.IR extension .If the substring following the final '.' is "gz" (i.e., it is a.BR gzip (1)-compressedfile), then the substring between the next-to-last '.' and the last '.'is returned as.IR extension ..LP.B QccFileOpen()opens the filespecified by.I filenamefor reading .RI ( mode = "r") orwriting.RI ( mode= "w").If.I filenameindicates that the file is compressed, .B QccFileOpen()opens the file for reading or writing compressed data(see "COMPRESSED-FILE ACCESS" below).Upon succesful completion,.B QccFileOpen()returns a.B FILEpointer.  Otherwise,.B NULLis returned..LP.BR QccFileDescriptorOpen()returns a.B FILEpointer for the file descriptor.IR file_descriptor .Usually, .IR file_descriptoris produced by opening a file via.BR open (2)or a pipe via.BR pipe (2) ..BR QccFileDescriptorOpen()calls.BR fdopen (3)..LP.B QccFileClose()closes a file previously opened by.BR QccFileOpen() or.BR QccFileDescriptorOpen() .If.I fileptrdoes not correspond to a file opened by.BR QccFileOpen() or.BR QccFileDescriptorOpen() ,.B QccFileClose()returns 1; otherwise a successful completion is indicated by a return value of0..LP.B QccFileSeekable()returns 1 if .I fileptris a seekable stream (i.e., not a pipe, socket, or FIFO), or 0otherwise..LP.B QccFileFlush()flushes the .I fileptrstream. See .BR fflush (3)..LP.B QccFileRemove()removes (deletes) the file named by.IR filename .If the remove fails for whatever reason (nonexistent file, insufficientprivilege for the remove, etc.) a value of 1 is returned; 0 is returnedon success..LP.B QccFileGetSize()returns the size of the file in bytes in the locationpointed to by.IR filesize .The file can bespecified by either its.IR filename ,or by giving a.B FILEpointer to it.The size of a compressed file cannot be determined from a.B FILEpointer, so use the.I filenamemethod..LP.B QccFileGetModTime()returns the modtime (time of last modification)of the file in the location pointed to by.IR modtime .The file can bespecified by either its.IR filename ,or by giving a.B FILEpointer to it.The modtime of a compressed file cannot be determined from a.B FILEpointer, so use the.I filenamemethod..B QccFileGetModTime()returns 0 for successful completion, 1 otherwise..LP.B QccFileGetCurrentPosition()returns the current value of the file-position indicator for the streampointed to by.IR infile ;the current position is returnedin the location pointed to by.IR current_position ..B QccFileGetCurrentPosition()does not work for compressed files..B QccFileGetCurrentPosition()returns 0 for successful completion, 1 otherwise..SH "COMPRESSED-FILE ACCESS"The QccPack file-access routines are able to read and write compressedfiles created by.BR gzip (1).When opening a file for reading or writing,.B QccFileOpen()checks the .I filenamefor a ".Z" or ".gz" extension.  If the.I filenamehas one of these extensions, it is assumed that the file is compressed.In this case, .B QccFileOpen()opens a pipe (via.BR popen (3))to.BR gzip (1)(for writing) or.BR gunzip (1)(for reading).All reading and writing of data to the compressed filethen goes through the pipe..LPFor each .B FILEpointer returned by.BR QccFileOpen() ,the QccPack library keeps track of whether the pointer corresponds toan actual file or a pipe; .B QccFileClose()then closes the file appropriately by calling.BR fclose (3) or.BR pclose (3)as needed..SH "SEE ALSO".BR fopen (3),.BR popen (3),.BR open (2),.BR fdopen (3),.BR pipe (2),.BR gzip (1),.BR gunzip (1),.BR QccPack (3).SH AUTHORCopyright (C) 1997-2009  James E. Fowler.\"  The programs herein are free software; you can redistribute them an.or.\"  modify them under the terms of the GNU General Public License.\"  as published by the Free Software Foundation; either version 2.\"  of the License, or (at your option) any later version..\"  .\"  These programs are distributed in the hope that they will be useful,.\"  but WITHOUT ANY WARRANTY; without even the implied warranty of.\"  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the.\"  GNU General Public License for more details..\"  .\"  You should have received a copy of the GNU General Public License.\"  along with these programs; if not, write to the Free Software.\"  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -