Unit TempFiles

DescriptionUsesClasses, Interfaces, Objects and RecordsFunctions and ProceduresTypesConstantsVariables

Description

TempFiles is used to generate the names of new temporary files and to delete those files when the program closes. During initialization of TempFiles, an application-specific temporary directory will be created if it does not already exist. If any files are in the directory and another instance of the program is not already running, the temporary directory will be cleared.

Uses

Overview

Classes, Interfaces, Objects and Records

Name Description
Class TTempFileStream Mode must be fmOpenRead, fmOpenWrite, or fmOpenReadWrite

Functions and Procedures

function TempFileName: string;
function GetAppSpecificTempDir: string;
procedure ZipAFile(const FileName: string; InStream: TMemoryStream);
procedure ExtractAFile(const FileName: string; OutStream: TMemoryStream);
procedure FreeMemory(const FileName: string);
function MemoryUsed(out FileCount: integer): Int64;

Description

Functions and Procedures

function TempFileName: string;

TempFileName generates a name for a new temporary file in an application-specific temporary directory. When the program closes, any file whose name matches a name generated by TempFileName will be deleted if it has not already been deleted.

function GetAppSpecificTempDir: string;

GetAppSpecificTempDir returns the name of a temporary directory where temporary files for an Application can be created. If the directory does not exist, GetAppSpecificTempDir will create it.

procedure ZipAFile(const FileName: string; InStream: TMemoryStream);
 
procedure ExtractAFile(const FileName: string; OutStream: TMemoryStream);

ExtractAFile reads the data associated with FileName into OutStream and sets the position of OutStream to 0.

procedure FreeMemory(const FileName: string);
 
function MemoryUsed(out FileCount: integer): Int64;
 

Generated by PasDoc 0.12.1 on 2013-05-13 15:42:05