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

📄 apr__file__info_8h-source.html

📁 apr函数库使用手册
💻 HTML
📖 第 1 页 / 共 3 页
字号:
00138 <span class="comment">/**</span>
00139 <span class="comment"> * Structure for determining the device the file is on.</span>
00140 <span class="comment"> */</span>
<a name="l00141"></a><a class="code" href="group__apr__file__info.html#ga3">00141</a> <span class="keyword">typedef</span> dev_t                     <a class="code" href="group__apr__file__info.html#ga3">apr_dev_t</a>;
00142 <span class="preprocessor">#endif</span>
00143 <span class="preprocessor"></span><span class="comment"></span>
00144 <span class="comment">/**</span>
00145 <span class="comment"> * @defgroup apr_file_stat Stat Functions</span>
00146 <span class="comment"> * @{</span>
00147 <span class="comment"> */</span><span class="comment"></span>
00148 <span class="comment">/** file info structure */</span>
<a name="l00149"></a><a class="code" href="group__apr__file__stat.html#ga0">00149</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structapr__finfo__t.html">apr_finfo_t</a>        <a class="code" href="group__apr__file__stat.html#ga0">apr_finfo_t</a>;
00150 
<a name="l00151"></a><a class="code" href="group__apr__file__stat.html#ga2">00151</a> <span class="preprocessor">#define APR_FINFO_LINK   0x00000001 </span><span class="comment">/**&lt; Stat the link not the file itself if it is a link */</span>
<a name="l00152"></a><a class="code" href="group__apr__file__stat.html#ga3">00152</a> <span class="preprocessor">#define APR_FINFO_MTIME  0x00000010 </span><span class="comment">/**&lt; Modification Time */</span>
<a name="l00153"></a><a class="code" href="group__apr__file__stat.html#ga4">00153</a> <span class="preprocessor">#define APR_FINFO_CTIME  0x00000020 </span><span class="comment">/**&lt; Creation or inode-changed time */</span>
<a name="l00154"></a><a class="code" href="group__apr__file__stat.html#ga5">00154</a> <span class="preprocessor">#define APR_FINFO_ATIME  0x00000040 </span><span class="comment">/**&lt; Access Time */</span>
<a name="l00155"></a><a class="code" href="group__apr__file__stat.html#ga6">00155</a> <span class="preprocessor">#define APR_FINFO_SIZE   0x00000100 </span><span class="comment">/**&lt; Size of the file */</span>
<a name="l00156"></a><a class="code" href="group__apr__file__stat.html#ga7">00156</a> <span class="preprocessor">#define APR_FINFO_CSIZE  0x00000200 </span><span class="comment">/**&lt; Storage size consumed by the file */</span>
<a name="l00157"></a><a class="code" href="group__apr__file__stat.html#ga8">00157</a> <span class="preprocessor">#define APR_FINFO_DEV    0x00001000 </span><span class="comment">/**&lt; Device */</span>
<a name="l00158"></a><a class="code" href="group__apr__file__stat.html#ga9">00158</a> <span class="preprocessor">#define APR_FINFO_INODE  0x00002000 </span><span class="comment">/**&lt; Inode */</span>
<a name="l00159"></a><a class="code" href="group__apr__file__stat.html#ga10">00159</a> <span class="preprocessor">#define APR_FINFO_NLINK  0x00004000 </span><span class="comment">/**&lt; Number of links */</span>
<a name="l00160"></a><a class="code" href="group__apr__file__stat.html#ga11">00160</a> <span class="preprocessor">#define APR_FINFO_TYPE   0x00008000 </span><span class="comment">/**&lt; Type */</span>
<a name="l00161"></a><a class="code" href="group__apr__file__stat.html#ga12">00161</a> <span class="preprocessor">#define APR_FINFO_USER   0x00010000 </span><span class="comment">/**&lt; User */</span>
<a name="l00162"></a><a class="code" href="group__apr__file__stat.html#ga13">00162</a> <span class="preprocessor">#define APR_FINFO_GROUP  0x00020000 </span><span class="comment">/**&lt; Group */</span>
<a name="l00163"></a><a class="code" href="group__apr__file__stat.html#ga14">00163</a> <span class="preprocessor">#define APR_FINFO_UPROT  0x00100000 </span><span class="comment">/**&lt; User protection bits */</span>
<a name="l00164"></a><a class="code" href="group__apr__file__stat.html#ga15">00164</a> <span class="preprocessor">#define APR_FINFO_GPROT  0x00200000 </span><span class="comment">/**&lt; Group protection bits */</span>
<a name="l00165"></a><a class="code" href="group__apr__file__stat.html#ga16">00165</a> <span class="preprocessor">#define APR_FINFO_WPROT  0x00400000 </span><span class="comment">/**&lt; World protection bits */</span>
<a name="l00166"></a><a class="code" href="group__apr__file__stat.html#ga17">00166</a> <span class="preprocessor">#define APR_FINFO_ICASE  0x01000000 </span><span class="comment">/**&lt; if dev is case insensitive */</span>
<a name="l00167"></a><a class="code" href="group__apr__file__stat.html#ga18">00167</a> <span class="preprocessor">#define APR_FINFO_NAME   0x02000000 </span><span class="comment">/**&lt; -&gt;name in proper case */</span>
00168 
<a name="l00169"></a><a class="code" href="group__apr__file__stat.html#ga19">00169</a> <span class="preprocessor">#define APR_FINFO_MIN    0x00008170 </span><span class="comment">/**&lt; type, mtime, ctime, atime, size */</span>
<a name="l00170"></a><a class="code" href="group__apr__file__stat.html#ga20">00170</a> <span class="preprocessor">#define APR_FINFO_IDENT  0x00003000 </span><span class="comment">/**&lt; dev and inode */</span>
<a name="l00171"></a><a class="code" href="group__apr__file__stat.html#ga21">00171</a> <span class="preprocessor">#define APR_FINFO_OWNER  0x00030000 </span><span class="comment">/**&lt; user and group */</span>
<a name="l00172"></a><a class="code" href="group__apr__file__stat.html#ga22">00172</a> <span class="preprocessor">#define APR_FINFO_PROT   0x00700000 </span><span class="comment">/**&lt;  all protections */</span>
<a name="l00173"></a><a class="code" href="group__apr__file__stat.html#ga23">00173</a> <span class="preprocessor">#define APR_FINFO_NORM   0x0073b170 </span><span class="comment">/**&lt;  an atomic unix apr_stat() */</span>
<a name="l00174"></a><a class="code" href="group__apr__file__stat.html#ga24">00174</a> <span class="preprocessor">#define APR_FINFO_DIRENT 0x02000000 </span><span class="comment">/**&lt;  an atomic unix apr_dir_read() */</span>
00175 <span class="comment"></span>
00176 <span class="comment">/**</span>
00177 <span class="comment"> * The file information structure.  This is analogous to the POSIX</span>
00178 <span class="comment"> * stat structure.</span>
00179 <span class="comment"> */</span>
<a name="l00180"></a><a class="code" href="structapr__finfo__t.html">00180</a> <span class="keyword">struct </span><a class="code" href="group__apr__file__stat.html#ga0">apr_finfo_t</a> {<span class="comment"></span>
00181 <span class="comment">    /** Allocates memory and closes lingering handles in the specified pool */</span>
<a name="l00182"></a><a class="code" href="structapr__finfo__t.html#o0">00182</a>     <a class="code" href="group__apr__pools.html#ga0">apr_pool_t</a> *<a class="code" href="structapr__finfo__t.html#o0">pool</a>;<span class="comment"></span>
00183 <span class="comment">    /** The bitmask describing valid fields of this apr_finfo_t structure </span>
00184 <span class="comment">     *  including all available 'wanted' fields and potentially more */</span>
<a name="l00185"></a><a class="code" href="structapr__finfo__t.html#o1">00185</a>     apr_int32_t <a class="code" href="structapr__finfo__t.html#o1">valid</a>;<span class="comment"></span>
00186 <span class="comment">    /** The access permissions of the file.  Mimics Unix access rights. */</span>
<a name="l00187"></a><a class="code" href="structapr__finfo__t.html#o2">00187</a>     <a class="code" href="group__apr__file__info.html#ga1">apr_fileperms_t</a> <a class="code" href="structapr__finfo__t.html#o2">protection</a>;<span class="comment"></span>
00188 <span class="comment">    /** The type of file.  One of APR_REG, APR_DIR, APR_CHR, APR_BLK, APR_PIPE, </span>
00189 <span class="comment">     * APR_LNK or APR_SOCK.  If the type is undetermined, the value is APR_NOFILE.</span>
00190 <span class="comment">     * If the type cannot be determined, the value is APR_UNKFILE.</span>
00191 <span class="comment">     */</span>
<a name="l00192"></a><a class="code" href="structapr__finfo__t.html#o3">00192</a>     <a class="code" href="group__apr__file__info.html#ga4">apr_filetype_e</a> <a class="code" href="structapr__finfo__t.html#o3">filetype</a>;<span class="comment"></span>
00193 <span class="comment">    /** The user id that owns the file */</span>
<a name="l00194"></a><a class="code" href="structapr__finfo__t.html#o4">00194</a>     <a class="code" href="group__apr__user.html#ga0">apr_uid_t</a> <a class="code" href="structapr__finfo__t.html#o4">user</a>;<span class="comment"></span>
00195 <span class="comment">    /** The group id that owns the file */</span>
<a name="l00196"></a><a class="code" href="structapr__finfo__t.html#o5">00196</a>     <a class="code" href="group__apr__user.html#ga1">apr_gid_t</a> <a class="code" href="structapr__finfo__t.html#o5">group</a>;<span class="comment"></span>
00197 <span class="comment">    /** The inode of the file. */</span>
<a name="l00198"></a><a class="code" href="structapr__finfo__t.html#o6">00198</a>     <a class="code" href="group__apr__file__info.html#ga2">apr_ino_t</a> <a class="code" href="structapr__finfo__t.html#o6">inode</a>;<span class="comment"></span>
00199 <span class="comment">    /** The id of the device the file is on. */</span>
<a name="l00200"></a><a class="code" href="structapr__finfo__t.html#o7">00200</a>     <a class="code" href="group__apr__file__info.html#ga3">apr_dev_t</a> <a class="code" href="structapr__finfo__t.html#o7">device</a>;<span class="comment"></span>
00201 <span class="comment">    /** The number of hard links to the file. */</span>
<a name="l00202"></a><a class="code" href="structapr__finfo__t.html#o8">00202</a>     apr_int32_t <a class="code" href="structapr__finfo__t.html#o8">nlink</a>;<span class="comment"></span>
00203 <span class="comment">    /** The size of the file */</span>
<a name="l00204"></a><a class="code" href="structapr__finfo__t.html#o9">00204</a>     apr_off_t <a class="code" href="structapr__finfo__t.html#o9">size</a>;<span class="comment"></span>
00205 <span class="comment">    /** The storage size consumed by the file */</span>
<a name="l00206"></a><a class="code" href="structapr__finfo__t.html#o10">00206</a>     apr_off_t <a class="code" href="structapr__finfo__t.html#o10">csize</a>;<span class="comment"></span>
00207 <span class="comment">    /** The time the file was last accessed */</span>
<a name="l00208"></a><a class="code" href="structapr__finfo__t.html#o11">00208</a>     <a class="code" href="group__apr__time.html#ga2">apr_time_t</a> <a class="code" href="structapr__finfo__t.html#o11">atime</a>;<span class="comment"></span>
00209 <span class="comment">    /** The time the file was last modified */</span>
<a name="l00210"></a><a class="code" href="structapr__finfo__t.html#o12">00210</a>     <a class="code" href="group__apr__time.html#ga2">apr_time_t</a> <a class="code" href="structapr__finfo__t.html#o12">mtime</a>;<span class="comment"></span>
00211 <span class="comment">    /** The time the file was created, or the inode was last changed */</span>
<a name="l00212"></a><a class="code" href="structapr__finfo__t.html#o13">00212</a>     <a class="code" href="group__apr__time.html#ga2">apr_time_t</a> <a class="code" href="structapr__finfo__t.html#o13">ctime</a>;<span class="comment"></span>
00213 <span class="comment">    /** The pathname of the file (possibly unrooted) */</span>
<a name="l00214"></a><a class="code" href="structapr__finfo__t.html#o14">00214</a>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="structapr__finfo__t.html#o14">fname</a>;<span class="comment"></span>
00215 <span class="comment">    /** The file's name (no path) in filesystem case */</span>
<a name="l00216"></a><a class="code" href="structapr__finfo__t.html#o15">00216</a>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="structapr__finfo__t.html#o15">name</a>;<span class="comment"></span>
00217 <span class="comment">    /** The file's handle, if accessed (can be submitted to apr_duphandle) */</span>
<a name="l00218"></a><a class="code" href="structapr__finfo__t.html#o16">00218</a>     <span class="keyword">struct </span><a class="code" href="group__apr__file__io.html#ga2">apr_file_t</a> *<a class="code" href="structapr__finfo__t.html#o16">filehand</a>;
00219 };
00220 <span class="comment"></span>
00221 <span class="comment">/**</span>
00222 <span class="comment"> * get the specified file's stats.  The file is specified by filename, </span>
00223 <span class="comment"> * instead of using a pre-opened file.</span>
00224 <span class="comment"> * @param finfo Where to store the information about the file, which is</span>
00225 <span class="comment"> * never touched if the call fails.</span>
00226 <span class="comment"> * @param fname The name of the file to stat.</span>
00227 <span class="comment"> * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values </span>
00228 <span class="comment"> * @param pool the pool to use to allocate the new file. </span>
00229 <span class="comment"> */</span> 
00230 APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const <span class="keywordtype">char</span> *fname,
00231                                    apr_int32_t wanted, apr_pool_t *pool);
00232 <span class="comment"></span>
00233 <span class="comment">/** @} */</span><span class="comment"></span>
00234 <span class="comment">/**</span>
00235 <span class="comment"> * @defgroup apr_dir Directory Manipulation Functions</span>
00236 <span class="comment"> * @{</span>
00237 <span class="comment"> */</span>
00238 <span class="comment"></span>
00239 <span class="comment">/**</span>
00240 <span class="comment"> * Open the specified directory.</span>
00241 <span class="comment"> * @param new_dir The opened directory descriptor.</span>
00242 <span class="comment"> * @param dirname The full path to the directory (use / on all systems)</span>
00243 <span class="comment"> * @param pool The pool to use.</span>
00244 <span class="comment"> */</span>                        
00245 APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new_dir, 
00246                                        const <span class="keywordtype">char</span> *dirname, 
00247                                        apr_pool_t *pool);
00248 <span class="comment"></span>
00249 <span class="comment">/**</span>
00250 <span class="comment"> * close the specified directory. </span>
00251 <span class="comment"> * @param thedir the directory descriptor to close.</span>
00252 <span class="comment"> */</span>                        
00253 APR_DECLARE(apr_status_t) apr_dir_close(apr_dir_t *thedir);
00254 <span class="comment"></span>
00255 <span class="comment">/**</span>
00256 <span class="comment"> * Read the next entry from the specified directory. </span>
00257 <span class="comment"> * @param finfo the file info structure and filled in by apr_dir_read</span>
00258 <span class="comment"> * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values </span>
00259 <span class="comment"> * @param thedir the directory descriptor returned from apr_dir_open</span>
00260 <span class="comment"> * @remark No ordering is guaranteed for the entries read.</span>
00261 <span class="comment"> */</span>                        
00262 APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
00263                                        apr_dir_t *thedir);
00264 <span class="comment"></span>
00265 <span class="comment">/**</span>
00266 <span class="comment"> * Rewind the directory to the first entry.</span>
00267 <span class="comment"> * @param thedir the directory descriptor to rewind.</span>
00268 <span class="comment"> */</span>                        
00269 APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir);<span class="comment"></span>
00270 <span class="comment">/** @} */</span>
00271 <span class="comment"></span>
00272 <span class="comment">/**</span>
00273 <span class="comment"> * @defgroup apr_filepath Filepath Manipulation Functions</span>
00274 <span class="comment"> * @{</span>
00275 <span class="comment"> */</span>
00276 <span class="comment"></span>
00277 <span class="comment">/** Cause apr_filepath_merge to fail if addpath is above rootpath */</span>
<a name="l00278"></a><a class="code" href="group__apr__filepath.html#ga7">00278</a> #define APR_FILEPATH_NOTABOVEROOT   0x01
00279 <span class="comment"></span>
00280 <span class="comment">/** internal: Only meaningful with APR_FILEPATH_NOTABOVEROOT */</span>
<a name="l00281"></a><a class="code" href="group__apr__filepath.html#ga8">00281</a> #define APR_FILEPATH_SECUREROOTTEST 0x02

⌨️ 快捷键说明

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