


Maps size bytes of the file into memory starting at offset. uchar *QFileDevice:: map( qint64 offset, qint64 size, QFileDevice::MemoryMapFlags flags = NoOptions) Most files support random-access, but some special files may not. Returns true if the file can only be manipulated sequentially otherwise returns false. Reimplements: QIODevice::isSequential() const. If the file is not open, or there is an error, handle() returns -1. Unix systems, but not Windows) the handle can be used with QSocketNotifier as well. On systems that use file descriptors for sockets (i.e. This is a small positive integer, suitable for use with C library functions such as fdopen() and fcntl(). Returns true if successful otherwise returns false. bool QFileDevice:: flush()įlushes any buffered data to the file. See also setFileTime(), FileTime, and QDateTime::isValid().

If the time cannot be determined return QDateTime() (an invalid date time). QDateTime QFileDevice:: fileTime( QFileDevice::FileTime time) const The default implementation in QFileDevice returns a null string. For example, if open() returns false, or a read/write operation returns -1, this function can be called to find out the reason why the operation failed. The I/O device status returns an error code. QFileDevice::FileError QFileDevice:: error() const void QFileDevice:: close()Ĭalls QFileDevice::flush() and closes the file. Therefore, you should not depend on atEnd() when reading data from such a file, but rather call read() until no more data can be read. those in /proc), this function returns true, since the file system reports that the size of such a file is 0. Returns true if the end of the file has been reached otherwise returns false.įor regular empty files on Unix (e.g. Member Function Documentation QFileDevice:: ~QFileDevice()ĭestroys the file device, closing it if necessary. This enum is used when opening a file to specify additional options which only apply to files and not to a generic QIODevice. The position in the file could not be changed.Įnum QFileDevice:: FileHandleFlag flags QFileDevice:: FileHandleFlags Out of resources (e.g., too many open files, out of memory, etc.) An error occurred when reading from the file.Īn error occurred when writing to the file.
