From 6212b2355152eeef10f3352276a41d5fbad77f6f Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Sun, 16 Nov 2008 18:23:23 +0100 Subject: Nested VFS archiving engines support --- vfs/UVFSCore.pas | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'vfs/UVFSCore.pas') diff --git a/vfs/UVFSCore.pas b/vfs/UVFSCore.pas index 270b240..7531e9c 100644 --- a/vfs/UVFSCore.pas +++ b/vfs/UVFSCore.pas @@ -92,6 +92,7 @@ type ArchiveMode: boolean; Password: string; PasswordUsed: boolean; + RemoveFileOnClose: string; constructor Create(SourcePlugin: TVFSPlugin); function VFSOpenURI(URI: string; AskQuestionCallback: PVFSAskQuestionCallback; AskPasswordCallback: PVFSAskPasswordCallback; ProgressCallback: PVFSProgressCallback; CallbackData: Pointer): boolean; function VFSOpenEx(OpenFile: string; AskQuestionCallback: PVFSAskQuestionCallback; AskPasswordCallback: PVFSAskPasswordCallback; ProgressCallback: PVFSProgressCallback; CallbackData: Pointer): TVFSResult; @@ -294,6 +295,7 @@ begin FGlobs := nil; Password := ''; PasswordUsed := False; + RemoveFileOnClose := ''; if @FSourcePlugin.FVFSNew <> nil then FGlobs := FSourcePlugin.FVFSNew(@VFSLogFunc); end; @@ -302,6 +304,9 @@ destructor TVFSEngine.Destroy; begin try if @FSourcePlugin.FVFSFree <> nil then FSourcePlugin.FVFSFree(FGlobs); + if Length(Trim(RemoveFileOnClose)) > 0 then + if unlink(PChar(RemoveFileOnClose)) <> 0 then + DebugMsg(['(EE) TVFSEngine.Destroy: error while removing ''', RemoveFileOnClose, ''': ', strerror(errno)]); except on E: Exception do DebugMsg(['*** TVFSEngine.Destroy() -Exception: ', E.Message]); end; -- cgit v1.2.3