Eneboo - Documentación para desarrolladores
'defines' | Funciones | Variables
Referencia del Archivo src/qt/src/tools/qfile_win.cpp
#include "qplatformdefs.h"
#include "qfile.h"
#include <qt_windows.h>




bool qt_file_access (const QString &fileName, int t)


const char * qt_fileerr_read

Documentación de los 'defines'


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 you have a buffered file opened for both reading and writing you must not perform an input operation immediately after an output operation or vice versa. You should always call flush() or a file positioning operation, e.g. seek(), between input and output operations, otherwise the buffer may contain garbage.

If the file does not exist and IO_WriteOnly or IO_ReadWrite is specified, it is created.


    QFile f1( "/tmp/data.bin" );
    QFile f2( "readme.txt" );
    f1.open( IO_Raw | IO_ReadWrite | IO_Append );
    f2.open( IO_ReadOnly | IO_Translate );
Ver también:
name(), close(), isOpen(), flush()

Documentación de las funciones

bool qt_file_access ( const QString fileName,
int  t 

Documentación de las variables

const char* qt_fileerr_read
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'