📄 apr__file__io_8h-source.html
字号:
00622 APR_DECLARE(apr_status_t) apr_file_data_get(<span class="keywordtype">void</span> **data, const <span class="keywordtype">char</span> *key,
00623 apr_file_t *file);
00624 <span class="comment"></span>
00625 <span class="comment">/**</span>
00626 <span class="comment"> * Set the data associated with the current file.</span>
00627 <span class="comment"> * @param file The currently open file.</span>
00628 <span class="comment"> * @param data The user data to associate with the file. </span>
00629 <span class="comment"> * @param key The key to use for assocaiteing data with the file.</span>
00630 <span class="comment"> * @param cleanup The cleanup routine to use when the file is destroyed.</span>
00631 <span class="comment"> */</span>
00632 APR_DECLARE(apr_status_t) apr_file_data_set(apr_file_t *file, <span class="keywordtype">void</span> *data,
00633 const <span class="keywordtype">char</span> *key,
00634 apr_status_t (*cleanup)(<span class="keywordtype">void</span> *));
00635 <span class="comment"></span>
00636 <span class="comment">/**</span>
00637 <span class="comment"> * Write a string to a file using a printf format.</span>
00638 <span class="comment"> * @param fptr The file to write to.</span>
00639 <span class="comment"> * @param format The format string</span>
00640 <span class="comment"> * @param ... The values to substitute in the format string</span>
00641 <span class="comment"> * @return The number of bytes written</span>
00642 <span class="comment"> */</span>
00643 APR_DECLARE_NONSTD(<span class="keywordtype">int</span>) apr_file_printf(apr_file_t *fptr,
00644 const <span class="keywordtype">char</span> *format, ...)
00645 __attribute__((format(printf,2,3)));
00646 <span class="comment"></span>
00647 <span class="comment">/**</span>
00648 <span class="comment"> * set the specified file's permission bits.</span>
00649 <span class="comment"> * @param fname The file (name) to apply the permissions to.</span>
00650 <span class="comment"> * @param perms The permission bits to apply to the file.</span>
00651 <span class="comment"> *</span>
00652 <span class="comment"> * @warning Some platforms may not be able to apply all of the</span>
00653 <span class="comment"> * available permission bits; APR_INCOMPLETE will be returned if some</span>
00654 <span class="comment"> * permissions are specified which could not be set.</span>
00655 <span class="comment"> *</span>
00656 <span class="comment"> * @warning Platforms which do not implement this feature will return</span>
00657 <span class="comment"> * APR_ENOTIMPL.</span>
00658 <span class="comment"> */</span>
00659 APR_DECLARE(apr_status_t) apr_file_perms_set(const <span class="keywordtype">char</span> *fname,
00660 apr_fileperms_t perms);
00661 <span class="comment"></span>
00662 <span class="comment">/**</span>
00663 <span class="comment"> * Set attributes of the specified file.</span>
00664 <span class="comment"> * @param fname The full path to the file (using / on all systems)</span>
00665 <span class="comment"> * @param attributes Or'd combination of</span>
00666 <span class="comment"> * <PRE></span>
00667 <span class="comment"> * APR_FILE_ATTR_READONLY - make the file readonly</span>
00668 <span class="comment"> * APR_FILE_ATTR_EXECUTABLE - make the file executable</span>
00669 <span class="comment"> * APR_FILE_ATTR_HIDDEN - make the file hidden</span>
00670 <span class="comment"> * </PRE></span>
00671 <span class="comment"> * @param attr_mask Mask of valid bits in attributes.</span>
00672 <span class="comment"> * @param pool the pool to use.</span>
00673 <span class="comment"> * @remark This function should be used in preference to explict manipulation</span>
00674 <span class="comment"> * of the file permissions, because the operations to provide these</span>
00675 <span class="comment"> * attributes are platform specific and may involve more than simply</span>
00676 <span class="comment"> * setting permission bits.</span>
00677 <span class="comment"> * @warning Platforms which do not implement this feature will return</span>
00678 <span class="comment"> * APR_ENOTIMPL.</span>
00679 <span class="comment"> */</span>
00680 APR_DECLARE(apr_status_t) apr_file_attrs_set(const <span class="keywordtype">char</span> *fname,
00681 apr_fileattrs_t attributes,
00682 apr_fileattrs_t attr_mask,
00683 apr_pool_t *pool);
00684 <span class="comment"></span>
00685 <span class="comment">/**</span>
00686 <span class="comment"> * Set the mtime of the specified file.</span>
00687 <span class="comment"> * @param fname The full path to the file (using / on all systems)</span>
00688 <span class="comment"> * @param mtime The mtime to apply to the file.</span>
00689 <span class="comment"> * @param pool The pool to use.</span>
00690 <span class="comment"> * @warning Platforms which do not implement this feature will return</span>
00691 <span class="comment"> * APR_ENOTIMPL.</span>
00692 <span class="comment"> */</span>
00693 APR_DECLARE(apr_status_t) apr_file_mtime_set(const <span class="keywordtype">char</span> *fname,
00694 apr_time_t mtime,
00695 apr_pool_t *pool);
00696 <span class="comment"></span>
00697 <span class="comment">/**</span>
00698 <span class="comment"> * Create a new directory on the file system.</span>
00699 <span class="comment"> * @param path the path for the directory to be created. (use / on all systems)</span>
00700 <span class="comment"> * @param perm Permissions for the new direcoty.</span>
00701 <span class="comment"> * @param pool the pool to use.</span>
00702 <span class="comment"> */</span>
00703 APR_DECLARE(apr_status_t) apr_dir_make(const <span class="keywordtype">char</span> *path, apr_fileperms_t perm,
00704 apr_pool_t *pool);
00705 <span class="comment"></span>
00706 <span class="comment">/** Creates a new directory on the file system, but behaves like</span>
00707 <span class="comment"> * 'mkdir -p'. Creates intermediate directories as required. No error</span>
00708 <span class="comment"> * will be reported if PATH already exists.</span>
00709 <span class="comment"> * @param path the path for the directory to be created. (use / on all systems)</span>
00710 <span class="comment"> * @param perm Permissions for the new direcoty.</span>
00711 <span class="comment"> * @param pool the pool to use.</span>
00712 <span class="comment"> */</span>
00713 APR_DECLARE(apr_status_t) apr_dir_make_recursive(const <span class="keywordtype">char</span> *path,
00714 apr_fileperms_t perm,
00715 apr_pool_t *pool);
00716 <span class="comment"></span>
00717 <span class="comment">/**</span>
00718 <span class="comment"> * Remove directory from the file system.</span>
00719 <span class="comment"> * @param path the path for the directory to be removed. (use / on all systems)</span>
00720 <span class="comment"> * @param pool the pool to use.</span>
00721 <span class="comment"> */</span>
00722 APR_DECLARE(apr_status_t) apr_dir_remove(const <span class="keywordtype">char</span> *path, apr_pool_t *pool);
00723 <span class="comment"></span>
00724 <span class="comment">/**</span>
00725 <span class="comment"> * get the specified file's stats.</span>
00726 <span class="comment"> * @param finfo Where to store the information about the file.</span>
00727 <span class="comment"> * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values </span>
00728 <span class="comment"> * @param thefile The file to get information about.</span>
00729 <span class="comment"> */</span>
00730 APR_DECLARE(apr_status_t) apr_file_info_get(<a class="code" href="structapr__finfo__t.html">apr_finfo_t</a> *finfo,
00731 apr_int32_t wanted,
00732 apr_file_t *thefile);
00733
00734 <span class="comment"></span>
00735 <span class="comment">/**</span>
00736 <span class="comment"> * Truncate the file's length to the specified offset</span>
00737 <span class="comment"> * @param fp The file to truncate</span>
00738 <span class="comment"> * @param offset The offset to truncate to.</span>
00739 <span class="comment"> */</span>
00740 APR_DECLARE(apr_status_t) apr_file_trunc(apr_file_t *fp, apr_off_t offset);
00741 <span class="comment"></span>
00742 <span class="comment">/**</span>
00743 <span class="comment"> * Retrieve the flags that were passed into apr_file_open()</span>
00744 <span class="comment"> * when the file was opened.</span>
00745 <span class="comment"> * @return apr_int32_t the flags</span>
00746 <span class="comment"> */</span>
00747 APR_DECLARE(apr_int32_t) apr_file_flags_get(apr_file_t *f);
00748 <span class="comment"></span>
00749 <span class="comment">/**</span>
00750 <span class="comment"> * Get the pool used by the file.</span>
00751 <span class="comment"> */</span>
00752 APR_POOL_DECLARE_ACCESSOR(file);
00753 <span class="comment"></span>
00754 <span class="comment">/**</span>
00755 <span class="comment"> * Set a file to be inherited by child processes.</span>
00756 <span class="comment"> *</span>
00757 <span class="comment"> */</span>
00758 APR_DECLARE_INHERIT_SET(file);
00759 <span class="comment"></span>
00760 <span class="comment">/**</span>
00761 <span class="comment"> * Unset a file from being inherited by child processes.</span>
00762 <span class="comment"> */</span>
00763 APR_DECLARE_INHERIT_UNSET(file);
00764 <span class="comment"></span>
00765 <span class="comment">/**</span>
00766 <span class="comment"> * Open a temporary file</span>
00767 <span class="comment"> * @param fp The apr file to use as a temporary file.</span>
00768 <span class="comment"> * @param templ The template to use when creating a temp file.</span>
00769 <span class="comment"> * @param flags The flags to open the file with. If this is zero,</span>
00770 <span class="comment"> * the file is opened with </span>
00771 <span class="comment"> * APR_CREATE | APR_READ | APR_WRITE | APR_EXCL | APR_DELONCLOSE</span>
00772 <span class="comment"> * @param p The pool to allocate the file out of.</span>
00773 <span class="comment"> * @remark </span>
00774 <span class="comment"> * This function generates a unique temporary file name from template. </span>
00775 <span class="comment"> * The last six characters of template must be XXXX
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -