📄 apr__file__io_8h-source.html
字号:
<a name="l00151"></a><a class="code" href="group__apr__file__io.html#ga0">00151</a> <span class="keyword">typedef</span> apr_uint32_t <a class="code" href="group__apr__file__io.html#ga0">apr_fileattrs_t</a>;
00152 <span class="comment"></span>
00153 <span class="comment">/** Type to pass as whence argument to apr_file_seek. */</span>
<a name="l00154"></a><a class="code" href="group__apr__file__io.html#ga1">00154</a> <span class="keyword">typedef</span> <span class="keywordtype">int</span> <a class="code" href="group__apr__file__io.html#ga1">apr_seek_where_t</a>;
00155 <span class="comment"></span>
00156 <span class="comment">/**</span>
00157 <span class="comment"> * Structure for referencing files.</span>
00158 <span class="comment"> */</span>
<a name="l00159"></a><a class="code" href="group__apr__file__io.html#ga2">00159</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="group__apr__file__io.html#ga2">apr_file_t</a> <a class="code" href="group__apr__file__io.html#ga2">apr_file_t</a>;
00160
00161 <span class="comment">/* File lock types/flags */</span><span class="comment"></span>
00162 <span class="comment">/**</span>
00163 <span class="comment"> * @defgroup apr_file_lock_types File Lock Types</span>
00164 <span class="comment"> * @{</span>
00165 <span class="comment"> */</span>
00166
<a name="l00167"></a><a class="code" href="group__apr__file__lock__types.html#ga0">00167</a> <span class="preprocessor">#define APR_FLOCK_SHARED 1 </span><span class="comment">/**< Shared lock. More than one process</span>
00168 <span class="comment"> or thread can hold a shared lock</span>
00169 <span class="comment"> at any given time. Essentially,</span>
00170 <span class="comment"> this is a "read lock", preventing</span>
00171 <span class="comment"> writers from establishing an</span>
00172 <span class="comment"> exclusive lock. */</span>
<a name="l00173"></a><a class="code" href="group__apr__file__lock__types.html#ga1">00173</a> <span class="preprocessor">#define APR_FLOCK_EXCLUSIVE 2 </span><span class="comment">/**< Exclusive lock. Only one process</span>
00174 <span class="comment"> may hold an exclusive lock at any</span>
00175 <span class="comment"> given time. This is analogous to</span>
00176 <span class="comment"> a "write lock". */</span>
00177
<a name="l00178"></a><a class="code" href="group__apr__file__lock__types.html#ga2">00178</a> <span class="preprocessor">#define APR_FLOCK_TYPEMASK 0x000F </span><span class="comment">/**< mask to extract lock type */</span>
<a name="l00179"></a><a class="code" href="group__apr__file__lock__types.html#ga3">00179</a> <span class="preprocessor">#define APR_FLOCK_NONBLOCK 0x0010 </span><span class="comment">/**< do not block while acquiring the</span>
00180 <span class="comment"> file lock */</span>
00181 <span class="comment">/** @} */</span>
00182 <span class="comment"></span>
00183 <span class="comment">/**</span>
00184 <span class="comment"> * Open the specified file.</span>
00185 <span class="comment"> * @param newf The opened file descriptor.</span>
00186 <span class="comment"> * @param fname The full path to the file (using / on all systems)</span>
00187 <span class="comment"> * @param flag Or'ed value of:</span>
00188 <span class="comment"> * <PRE></span>
00189 <span class="comment"> * APR_READ open for reading</span>
00190 <span class="comment"> * APR_WRITE open for writing</span>
00191 <span class="comment"> * APR_CREATE create the file if not there</span>
00192 <span class="comment"> * APR_APPEND file ptr is set to end prior to all writes</span>
00193 <span class="comment"> * APR_TRUNCATE set length to zero if file exists</span>
00194 <span class="comment"> * APR_BINARY not a text file (This flag is ignored on </span>
00195 <span class="comment"> * UNIX because it has no meaning)</span>
00196 <span class="comment"> * APR_BUFFERED buffer the data. Default is non-buffered</span>
00197 <span class="comment"> * APR_EXCL return error if APR_CREATE and file exists</span>
00198 <span class="comment"> * APR_DELONCLOSE delete the file after closing.</span>
00199 <span class="comment"> * APR_XTHREAD Platform dependent tag to open the file</span>
00200 <span class="comment"> * for use across multiple threads</span>
00201 <span class="comment"> * APR_SHARELOCK Platform dependent support for higher</span>
00202 <span class="comment"> * level locked read/write access to support</span>
00203 <span class="comment"> * writes across process/machines</span>
00204 <span class="comment"> * APR_FILE_NOCLEANUP Do not register a cleanup with the pool </span>
00205 <span class="comment"> * passed in on the <EM>pool</EM> argument (see below).</span>
00206 <span class="comment"> * The apr_os_file_t handle in apr_file_t will not</span>
00207 <span class="comment"> * be closed when the pool is destroyed.</span>
00208 <span class="comment"> * APR_SENDFILE_ENABLED Open with appropriate platform semantics</span>
00209 <span class="comment"> * for sendfile operations. Advisory only,</span>
00210 <span class="comment"> * apr_socket_sendfile does not check this flag.</span>
00211 <span class="comment"> * </PRE></span>
00212 <span class="comment"> * @param perm Access permissions for file.</span>
00213 <span class="comment"> * @param pool The pool to use.</span>
00214 <span class="comment"> * @remark If perm is APR_OS_DEFAULT and the file is being created,</span>
00215 <span class="comment"> * appropriate default permissions will be used.</span>
00216 <span class="comment"> */</span>
00217 APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **newf, const <span class="keywordtype">char</span> *fname,
00218 apr_int32_t flag, apr_fileperms_t perm,
00219 apr_pool_t *pool);
00220 <span class="comment"></span>
00221 <span class="comment">/**</span>
00222 <span class="comment"> * Close the specified file.</span>
00223 <span class="comment"> * @param file The file descriptor to close.</span>
00224 <span class="comment"> */</span>
00225 APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file);
00226 <span class="comment"></span>
00227 <span class="comment">/**</span>
00228 <span class="comment"> * Delete the specified file.</span>
00229 <span class="comment"> * @param path The full path to the file (using / on all systems)</span>
00230 <span class="comment"> * @param pool The pool to use.</span>
00231 <span class="comment"> * @remark If the file is open, it won't be removed until all</span>
00232 <span class="comment"> * instances are closed.</span>
00233 <span class="comment"> */</span>
00234 APR_DECLARE(apr_status_t) apr_file_remove(const <span class="keywordtype">char</span> *path, apr_pool_t *pool);
00235 <span class="comment"></span>
00236 <span class="comment">/**</span>
00237 <span class="comment"> * Rename the specified file.</span>
00238 <span class="comment"> * @param from_path The full path to the original file (using / on all systems)</span>
00239 <span class="comment"> * @param to_path The full path to the new file (using / on all systems)</span>
00240 <span class="comment"> * @param pool The pool to use.</span>
00241 <span class="comment"> * @warning If a file exists at the new location, then it will be</span>
00242 <span class="comment"> * overwritten. Moving files or directories across devices may not be</span>
00243 <span class="comment"> * possible.</span>
00244 <span class="comment"> */</span>
00245 APR_DECLARE(apr_status_t) apr_file_rename(const <span class="keywordtype">char</span> *from_path,
00246 const <span class="keywordtype">char</span> *to_path,
00247 apr_pool_t *pool);
00248 <span class="comment"></span>
00249 <span class="comment">/**</span>
00250 <span class="comment"> * Copy the specified file to another file.</span>
00251 <span class="comment"> * @param from_path The full path to the original file (using / on all systems)</span>
00252 <span class="comment"> * @param to_path The full path to the new file (using / on all systems)</span>
00253 <span class="comment"> * @param perms Access permissions for the new file if it is created.</span>
00254 <span class="comment"> * In place of the usual or'd combination of file permissions, the</span>
00255 <span class="comment"> * value APR_FILE_SOURCE_PERMS may be given, in which case the source</span>
00256 <span class="comment"> * file's permissions are copied.</span>
00257 <span class="comment"> * @param pool The pool to use.</span>
00258 <span class="comment"> * @remark The new file does not need to exist, it will be created if required.</span>
00259 <span class="comment"> * @warning If the new file already exists, its contents will be overwritten.</span>
00260 <span class="comment"> */</span>
00261 APR_DECLARE(apr_status_t) apr_file_copy(const <span class="keywordtype">char</span> *from_path,
00262 const <span class="keywordtype">char</span> *to_path,
00263 apr_fileperms_t perms,
00264 apr_pool_t *pool);
00265 <span class="comment"></span>
00266 <span class="comment">/**</span>
00267 <span class="comment"> * Append the specified file to another file.</span>
00268 <span class="comment"> * @param from_path The full path to the source file (use / on all systems)</span>
00269 <span class="comment"> * @param to_path The full path to the destination file (use / on all systems)</span>
00270 <span class="comment"> * @param perms Access permissions for the destination file if it is created.</span>
00271 <span class="comment"> * In place of the usual or'd combination of file permissions, the</span>
00272 <span class="comment"> * value APR_FILE_SOURCE_PERMS may be given, in which case the source</span>
00273 <span class="comment"> * file's permissions are copied.</span>
00274 <span class="comment"> * @param pool The pool to use.</span>
00275 <span class="comment"> * @remark The new file does not need to exist, it will be created if required.</span>
00276 <span class="comment"> */</span>
00277 APR_DECLARE(apr_status_t) apr_file_append(const <span class="keywordtype">char</span> *from_path,
00278 const <span class="keywordtype">char</span> *to_path,
00279 apr_fileperms_t perms,
00280 apr_pool_t *pool);
00281 <span class="comment"></span>
00282 <span class="comment">/**</span>
00283 <span class="comment"> * Are we at the end of the file</span>
00284 <span class="comment"> * @param fptr The apr file we are testing.</span>
00285 <span class="comment"> * @remark Returns APR_EOF if we are at the end of file, APR_SUCCESS otherwise.</span>
00286 <span class="comment"> */</span>
00287 APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr);
00288 <span class="comment"></span>
00289 <span class="comment">/**</span>
00290 <span class="comment"> * Open standard error as an apr file pointer.</span>
00291 <span class="comment"> * @param thefile The apr file to use as stderr.</span>
00292 <span class="comment"> * @param pool The pool to allocate the file out of.</span>
00293 <span class="comment"> * </span>
00294 <span class="comment"> * @remark The only reason that the apr_file_open_std* functions exist</span>
00295 <span class="comment"> * is that you may not always have a stderr/out/in on Windows. This</span>
00296 <span class="comment"> * is generally a problem with newer versions of Windows and services.</span>
00297 <span class="comment"> * </span>
00298 <span class="comment"> * @remark The other problem is that the C library functions generally work</span>
00299 <span class="comment"> * differently on Windows and Unix. So, by using apr_file_open_std*</span>
00300 <span class="comment"> * functions, you can get a handle to an APR struct that works with</span>
00301 <span class="comment"> * the APR functions which are supposed to work identically on all</span>
00302 <span class="comment"> * platforms.</span>
00303 <span class="comment"> */</span>
00304 APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile,
00305 apr_pool_t *pool);
00306 <span class="comment"></span>
00307 <span class="comment">/**</span>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -