# class KSaveFile | The KSaveFile class has been made to write out changes to an existing file atomically. More...
Definition | `#include <ksavefile.h>`
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- KSaveFile (const QString &filename, int mode = 0666 )
- ~KSaveFile ()
- int status ()
- QString name ()
- int handle ()
- FILE * fstream ()
- QFile * file ()
- QTextStream * textStream ()
- QDataStream * dataStream ()
- void abort ()
- bool close ()

## Detailed Description

The KSaveFile class has been made to write out changes to an existing file atomically. This means that EITHER: a) All changes have been written successfully to the file.

b) Some error occured, no changes have been written whatsoever and the old file is still in place.

KSaveFile (const QString &filename, int mode = 0666 ) | ### KSaveFile

~KSaveFile () | ### ~KSaveFile

The destructor closes the file.

int status () | ### status

Returns the status of the file based on errno. (see errno.h) 0 means OK.

You should check the status after object creation to check whether a file could be created in the first place.

You may check the status after closing the file to verify that the file has indeed been written correctly.

QString name () | ### name

The name of the file as passed to the constructor.

int handle () | ### handle

An integer file descriptor open for writing to the file

FILE * fstream () | ### fstream

A FILE* stream open for writing to the file

QFile * file () | ### file

A QFile* open for writing to the file

QTextStream * textStream () | ### textStream

A QTextStream* open for writing to the file

QDataStream * dataStream () | ### dataStream

A QDataStream* open for writing to the file

void abort () | ### abort

Aborts the write operation and removes any intermediate files This implies a close.

bool close () | ### close

Closes the file and makes the changes definitive. Returns 'true' is successfull, or 'false' if an error has occured. See status() for details about errors.

Generated by: root@i386.ports.openbsd.org on Wed Apr 25 13:58:13 2001, using kdoc 2.0a53.