diff options
Diffstat (limited to 'zip')
| -rw-r--r-- | zip/zip.cpp | 45 |
1 files changed, 38 insertions, 7 deletions
diff --git a/zip/zip.cpp b/zip/zip.cpp index 4a07b01..035b4b2 100644 --- a/zip/zip.cpp +++ b/zip/zip.cpp @@ -1,5 +1,5 @@ /* ZIP plugin for Tux Commander - * version 0.6.0, designed for ZipArchive v3.2.0 + * version 0.6.1, designed for ZipArchive v3.2.0 * Copyright (C) 2004-2009 Tomas Bzatek <tbzatek@users.sourceforge.net> * Check for updates on tuxcmd.sourceforge.net * @@ -47,8 +47,8 @@ -#define VERSION "0.6.0" -#define BUILD_DATE "2009-11-28" +#define VERSION "0.6.1" +#define BUILD_DATE "2009-11-29" #define DEFAULT_BLOCK_SIZE 65536 @@ -927,6 +927,40 @@ VFSTwoSameFiles (struct TVFSGlobs *globs, const char *Path1, const char *Path2, //////////////////////// +TVFSResult +VFSStartCopyOperation (struct TVFSGlobs *globs) +{ + TVFSResult Result; + + g_return_val_if_fail (globs != NULL, cVFS_Failed); + + printf ("(II) VFSStartCopyOperation: doing nothing for the moment.\n"); + Result = cVFS_OK; + + return Result; +} + + +TVFSResult +VFSStopCopyOperation (struct TVFSGlobs *globs) +{ + TVFSResult Result; + + g_return_val_if_fail (globs != NULL, cVFS_Failed); + + if (globs->archive_modified) { + printf ("(II) VFSStopCopyOperation: rebuilding tree.\n"); + globs->zip->Flush (); + build_global_filelist (globs); + } else { + printf ("(II) VFSStartCopyOperation: doing nothing for the moment.\n"); + } + Result = cVFS_OK; + + return Result; +} + + /* Known issues: * - crashes when no space left on NFS mounts, probably unhandled exception in further ZipArchive code (repro: Gentoo, Ubuntu) * @@ -1039,14 +1073,11 @@ VFSCopyFromLocal (struct TVFSGlobs *globs, const char *sSrcName, const char *sDs if (! globs->zip->AddNewFile (sSrcName, s, -1, CZipArchive::zipsmSafeSmart, globs->block_size)) { globs->zip->CloseNewFile (true); globs->zip->CloseFile (NULL, true); - build_global_filelist (globs); fprintf (stderr, "(EE) VFSCopyFromLocal: Error while copying in, archive closed = %d.\n", globs->zip->IsClosed ()); return cVFS_WriteErr; } - globs->zip->Flush (); printf ("(II) VFSCopyFromLocal: copy OK, archive closed = %d.\n", globs->zip->IsClosed ()); - build_global_filelist (globs); globs->archive_modified = TRUE; /* @@ -1068,7 +1099,6 @@ VFSCopyFromLocal (struct TVFSGlobs *globs, const char *sSrcName, const char *sDs catch (CZipException e) { globs->zip->CloseNewFile (true); globs->zip->CloseFile (NULL, true); - build_global_filelist (globs); fprintf (stderr, "(EE) VFSCopyFromLocal: Error while copying in: [%d] %s, archive closed = %d.\n", e.m_iCause, (LPCTSTR)e.GetErrorDescription(), globs->zip->IsClosed()); switch (e.m_iCause) { @@ -1118,6 +1148,7 @@ VFSCopyFromLocal (struct TVFSGlobs *globs, const char *sSrcName, const char *sDs * - readonly checking IsReadOnly() + add tests to all functions modifying the archive * - after VFS API update implement archive testing, compression level setting, retrieving compression info for each file and archive, readonly flags, begin-action, end-action (no refresh, faster operations) ... * - moving files from one directory to another within the archive +* - do something like start/stop operation for write, so that chmod/chown/utime calls can find newly packed file. * */ |
