|
Eneboo - Documentación para desarrolladores
|
#include "qplatformdefs.h"#include "qfile.h"#include <qt_windows.h>'defines' | |
| #define | HAS_TEXT_FILEMODE |
Funciones | |
| bool | qt_file_access (const QString &fileName, int t) |
Variables | |
| const char * | qt_fileerr_read |
| #define HAS_TEXT_FILEMODE |
Opens the file specified by the file name currently set, using the mode m. Returns TRUE if successful, otherwise FALSE.
IO_Raw IO_ReadOnly IO_WriteOnly IO_ReadWrite IO_Append IO_Truncate IO_Translate
The mode parameter m must be a combination of the following flags: IO_Raw specified raw (non-buffered) file access. IO_ReadOnly opens the file in read-only mode. IO_WriteOnly opens the file in write-only mode (and truncates). IO_ReadWrite opens the file in read/write mode, equivalent to (IO_ReadOnly | IO_WriteOnly). IO_Append opens the file in append mode. This mode is very useful when you want to write something to a log file. The file index is set to the end of the file. Note that the result is undefined if you position the file index manually using at() in append mode. IO_Truncate truncates the file. IO_Translate enables carriage returns and linefeed translation for text files under MS-DOS, Windows and OS/2.
The raw access mode is best when I/O is block-operated using 4kB block size or greater. Buffered access works better when reading small portions of data at a time.
Important: When working with buffered files, data may not be written to the file at once. Call flush() to make sure that the data is really written.
If the file does not exist and IO_WriteOnly or IO_ReadWrite is specified, it is created.
Example:
QFile f1( "/tmp/data.bin" ); QFile f2( "readme.txt" ); f1.open( IO_Raw | IO_ReadWrite | IO_Append ); f2.open( IO_ReadOnly | IO_Translate );
| const char* qt_fileerr_read |
1.7.4