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

📄 qfileinfo.3qt

📁 Linux下的基于X11的图形开发环境。
💻 3QT
📖 第 1 页 / 共 2 页
字号:
.PPSee also dirPath(), filePath(), fileName(), and isRelative()..PPExample: fileiconview/qfileiconview.cpp..SH "QString QFileInfo::dirPath ( bool absPath = FALSE ) const"Returns the file's path..PPIf \fIabsPath\fR is TRUE an absolute path is returned..PPSee also dir(), filePath(), fileName(), and isRelative()..PPExample: fileiconview/qfileiconview.cpp..SH "bool QFileInfo::exists () const"Returns TRUE if the file exists; otherwise returns FALSE..PPExamples:.)l biff/biff.cpp and i18n/main.cpp..SH "QString QFileInfo::extension ( bool complete = TRUE ) const"Returns the file's extension name..PPIf \fIcomplete\fR is TRUE (the default), extension() returns the string of all characters in the file name after (but not including) the first '.' character..PPIf \fIcomplete\fR is FALSE, extension() returns the string of all characters in the file name after (but not including) the last '.' character..PPExample:.PP.nf.br        QFileInfo fi( "/tmp/archive.tar.gz" );.br        QString ext = fi.extension();  // ext = "tar.gz".br        ext = fi.extension( FALSE );   // ext = "gz".br.fi.PPSee also fileName() and baseName()..PPExample: qdir/qdir.cpp..SH "QString QFileInfo::fileName () const"Returns the name of the file, excluding the path..PPExample:.PP.nf.br        QFileInfo fi( "/tmp/archive.tar.gz" );.br        QString name = fi.fileName();           // name = "archive.tar.gz".br.fi.PPSee also isRelative(), filePath(), baseName(), and extension()..PPExamples:.)l dirview/dirview.cpp, fileiconview/qfileiconview.cpp, and network/ftpclient/ftpmainwindow.ui.h..SH "QString QFileInfo::filePath () const"Returns the file name, including the path (which may be absolute or relative)..PPSee also isRelative() and absFilePath()..PPExamples:.)l dirview/main.cpp and fileiconview/qfileiconview.cpp..SH "QString QFileInfo::group () const"Returns the group of the file. On Windows, on systems where files do not have groups, or if an error occurs, QString::null is returned..PPThis function can be time consuming under Unix (in the order of milliseconds)..PPSee also groupId(), owner(), and ownerId()..SH "uint QFileInfo::groupId () const"Returns the id of the group the file belongs to..PPOn Windows and on systems where files do not have groups this function always returns (uint) -2..PPSee also group(), owner(), and ownerId()..SH "bool QFileInfo::isDir () const"Returns TRUE if this object points to a directory or to a symbolic link to a directory; otherwise returns FALSE..PPSee also isFile() and isSymLink()..PPExamples:.)l dirview/dirview.cpp and fileiconview/qfileiconview.cpp..SH "bool QFileInfo::isExecutable () const"Returns TRUE if the file is executable; otherwise returns FALSE..PPSee also isReadable(), isWritable(), and permission()..SH "bool QFileInfo::isFile () const"Returns TRUE if this object points to a file. Returns FALSE if the object points to something which isn't a file, e.g. a directory or a symlink..PPSee also isDir() and isSymLink()..PPExamples:.)l dirview/dirview.cpp, fileiconview/qfileiconview.cpp, and qdir/qdir.cpp..SH "bool QFileInfo::isHidden () const"Returns TRUE if the file is hidden; otherwise returns FALSE..PPOn Unix-like operating systems, including Mac OS X, a file is hidden if its name begins with ".". On Windows a file is hidden if its hidden attribute is set..SH "bool QFileInfo::isReadable () const"Returns TRUE if the file is readable; otherwise returns FALSE..PPSee also isWritable(), isExecutable(), and permission()..SH "bool QFileInfo::isRelative () const"Returns TRUE if the file path name is relative. Returns FALSE if the path is absolute (e.g. under Unix a path is absolute if it begins with a "/")..SH "bool QFileInfo::isSymLink () const"Returns TRUE if this object points to a symbolic link (or to a shortcut on Windows); otherwise returns FALSE..PPSee also isFile(), isDir(), and readLink()..PPExamples:.)l dirview/dirview.cpp and fileiconview/qfileiconview.cpp..SH "bool QFileInfo::isWritable () const"Returns TRUE if the file is writable; otherwise returns FALSE..PPSee also isReadable(), isExecutable(), and permission()..SH "QDateTime QFileInfo::lastModified () const"Returns the date and time when the file was last modified..PPSee also created() and lastRead()..PPExample: biff/biff.cpp..SH "QDateTime QFileInfo::lastRead () const"Returns the date and time when the file was last read (accessed)..PPOn platforms where this information is not available, returns the same as lastModified()..PPSee also created() and lastModified()..PPExample: biff/biff.cpp..SH "QFileInfo & QFileInfo::operator= ( const QFileInfo & fi )"Makes a copy of \fIfi\fR and assigns it to this QFileInfo..SH "QString QFileInfo::owner () const"Returns the owner of the file. On Windows, on systems where files do not have owners, or if an error occurs, QString::null is returned..PPThis function can be time consuming under Unix (in the order of milliseconds)..PPSee also ownerId(), group(), and groupId()..SH "uint QFileInfo::ownerId () const"Returns the id of the owner of the file..PPOn Windows and on systems where files do not have owners this function returns ((uint) -2)..PPSee also owner(), group(), and groupId()..SH "bool QFileInfo::permission ( int permissionSpec ) const"Tests for file permissions. The \fIpermissionSpec\fR argument can be several flags of type PermissionSpec OR-ed together to check for permission combinations..PPOn systems where files do not have permissions this function always returns TRUE..PPExample:.PP.nf.br        QFileInfo fi( "/tmp/archive.tar.gz" );.br        if ( fi.permission( QFileInfo::WriteUser | QFileInfo::ReadGroup ) ).br            qWarning( "I can change the file; my group can read the file.");.br        if ( fi.permission( QFileInfo::WriteGroup | QFileInfo::WriteOther ) ).br            qWarning( "The group or others can change the file!" );.br.fi.PPSee also isReadable(), isWritable(), and isExecutable()..SH "QString QFileInfo::readLink () const"Returns the name a symlink (or shortcut on Windows) points to, or a QString::null if the object isn't a symbolic link..PPThis name may not represent an existing file; it is only a string. QFileInfo::exists() returns TRUE if the symlink points to an existing file..PPSee also exists(), isSymLink(), isDir(), and isFile()..SH "void QFileInfo::refresh () const"Refreshes the information about the file, i.e. reads in information from the file system the next time a cached property is fetched..PPSee also setCaching()..SH "void QFileInfo::setCaching ( bool enable )"If \fIenable\fR is TRUE, enables caching of file information. If \fIenable\fR is FALSE caching is disabled..PPWhen caching is enabled, QFileInfo reads the file information from the file system the first time it's needed, but generally not later..PPCaching is enabled by default..PPSee also refresh() and caching()..SH "void QFileInfo::setFile ( const QString & file )"Sets the file that the QFileInfo provides information about to \fIfile\fR..PPThe \fIfile\fR can also include an absolute or relative file path. Absolute paths begin with the directory separator (e.g. "/" under Unix) or a drive specification (under Windows). Relative file names begin with a directory name or a file name and specify a path relative to the current directory..PPExample:.PP.nf.br    QString absolute = "/local/bin";.br    QString relative = "local/bin";.br    QFileInfo absFile( absolute );.br    QFileInfo relFile( relative );.br.br    QDir::setCurrent( QDir::rootDirPath() );.br    // absFile and relFile now point to the same file.br.br    QDir::setCurrent( "/tmp" );.br    // absFile now points to "/local/bin",.br    // while relFile points to "/tmp/local/bin".br.fi.PPSee also isRelative(), QDir::setCurrent(), and QDir::isRelativePath()..PPExample: biff/biff.cpp..SH "void QFileInfo::setFile ( const QFile & file )"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPSets the file that the QFileInfo provides information about to \fIfile\fR..PPIf \fIfile\fR includes a relative path, the QFileInfo will also have a relative path..PPSee also isRelative()..SH "void QFileInfo::setFile ( const QDir & d, const QString & fileName )"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPSets the file that the QFileInfo provides information about to \fIfileName\fR in directory \fId\fR..PPIf \fIfileName\fR includes a relative path, the QFileInfo will also have a relative path..PPSee also isRelative()..SH "uint QFileInfo::size () const"Returns the file size in bytes, or 0 if the file does not exist or if the size is 0 or if the size cannot be fetched..PPExample: qdir/qdir.cpp..SH "SEE ALSO".BR http://doc.trolltech.com/qfileinfo.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com.  See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports help us to help you. Thank you..PThe definitive Qt documentation is provided in HTML format; it islocated at $QTDIR/doc/html and can be read using Qt Assistant or witha web browser. This man page is provided as a convenience for thoseusers who prefer man pages, although this format is not officiallysupported by Trolltech. .PIf you find errors in this manual page, please report them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qfileinfo.3qt) and the Qtversion (3.1.1).

⌨️ 快捷键说明

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