From 7f23ee90fd545995a29e2175f15e8b97e59ca67a Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 17:13:13 +0200 Subject: 3.20 --- Application.cpp | 4 +- Application.h | 2 +- BUILD/Changelog.txt | 16 +- BUILD/FreeFileSync.chm | Bin 503908 -> 503908 bytes BUILD/Languages/chinese_simple.lng | 65 +-- BUILD/Languages/chinese_traditional.lng | 65 +-- BUILD/Languages/czech.lng | 65 +-- BUILD/Languages/danish.lng | 65 +-- BUILD/Languages/dutch.lng | 67 +-- BUILD/Languages/english_uk.lng | 68 +-- BUILD/Languages/finnish.lng | 65 +-- BUILD/Languages/french.lng | 65 +-- BUILD/Languages/german.lng | 66 +-- BUILD/Languages/greek.lng | 65 +-- BUILD/Languages/hebrew.lng | 65 +-- BUILD/Languages/hungarian.lng | 65 +-- BUILD/Languages/italian.lng | 65 +-- BUILD/Languages/japanese.lng | 65 +-- BUILD/Languages/korean.lng | 65 +-- BUILD/Languages/polish.lng | 65 +-- BUILD/Languages/portuguese.lng | 65 +-- BUILD/Languages/portuguese_br.lng | 65 +-- BUILD/Languages/romanian.lng | 65 +-- BUILD/Languages/russian.lng | 65 +-- BUILD/Languages/slovenian.lng | 65 +-- BUILD/Languages/spanish.lng | 65 +-- BUILD/Languages/swedish.lng | 65 +-- BUILD/Languages/turkish.lng | 65 +-- BUILD/Languages/ukrainian.lng | 65 +-- BUILD/Resources.dat | Bin 333098 -> 333128 bytes FreeFileSync - wxWidgets v2.9.2 Beta.vcxproj | 1 - FreeFileSync.cbp | 8 +- FreeFileSync.vcxproj | 9 +- Makefile | 17 +- RealtimeSync/RealtimeSync.cbp | 3 +- RealtimeSync/RealtimeSync.vcxproj | 7 +- RealtimeSync/application.cpp | 2 +- RealtimeSync/application.h | 2 +- RealtimeSync/main_dlg.cpp | 2 +- RealtimeSync/main_dlg.h | 2 +- RealtimeSync/makefile | 1 - RealtimeSync/resources.cpp | 2 +- RealtimeSync/resources.h | 2 +- RealtimeSync/tray_menu.cpp | 6 +- RealtimeSync/tray_menu.h | 2 +- RealtimeSync/watcher.cpp | 14 +- RealtimeSync/watcher.h | 2 +- RealtimeSync/xml_ffs.cpp | 2 +- RealtimeSync/xml_ffs.h | 2 +- RealtimeSync/xml_proc.cpp | 2 +- RealtimeSync/xml_proc.h | 2 +- algorithm.cpp | 6 +- algorithm.h | 2 +- comparison.cpp | 602 ++++++++------------------ comparison.h | 13 +- file_hierarchy.cpp | 2 +- file_hierarchy.h | 32 +- library/binary.cpp | 13 +- library/binary.h | 2 +- library/custom_grid.cpp | 2 +- library/custom_grid.h | 2 +- library/db_file.cpp | 91 ++-- library/db_file.h | 2 +- library/detect_renaming.cpp | 2 +- library/detect_renaming.h | 2 +- library/dir_exist_async.h | 35 ++ library/dir_lock.cpp | 9 +- library/error_log.cpp | 2 +- library/error_log.h | 2 +- library/hard_filter.cpp | 2 +- library/hard_filter.h | 2 +- library/icon_buffer.cpp | 332 +++++++------- library/icon_buffer.h | 2 +- library/lock_holder.h | 8 +- library/norm_filter.h | 2 +- library/parallel_scan.cpp | 617 +++++++++++++++++++++++++++ library/parallel_scan.h | 74 ++++ library/process_xml.cpp | 10 +- library/process_xml.h | 2 +- library/resources.cpp | 2 +- library/resources.h | 2 +- library/soft_filter.h | 2 +- library/statistics.cpp | 2 +- library/statistics.h | 2 +- library/status_handler.cpp | 2 +- library/status_handler.h | 2 +- shared/IFileOperation/dll_main.cpp | 2 +- shared/IFileOperation/file_op.cpp | 2 +- shared/IFileOperation/file_op.h | 2 +- shared/ShadowCopy/LockFile.cpp | 2 +- shared/ShadowCopy/dll_main.cpp | 2 +- shared/ShadowCopy/shadow.cpp | 2 +- shared/ShadowCopy/shadow.h | 2 +- shared/Taskbar_Seven/dll_main.cpp | 2 +- shared/Taskbar_Seven/taskbar.cpp | 2 +- shared/Taskbar_Seven/taskbar.h | 2 +- shared/app_main.cpp | 2 +- shared/app_main.h | 2 +- shared/build_info.h | 2 +- shared/c_dll.h | 2 +- shared/check_exist.cpp | 58 --- shared/check_exist.h | 71 ++- shared/com_error.h | 2 +- shared/com_ptr.h | 2 +- shared/com_util.h | 2 +- shared/custom_button.cpp | 2 +- shared/custom_button.h | 2 +- shared/custom_combo_box.cpp | 2 +- shared/custom_combo_box.h | 2 +- shared/custom_tooltip.cpp | 2 +- shared/custom_tooltip.h | 2 +- shared/debug_log.h | 2 +- shared/debug_new.cpp | 2 +- shared/debug_new.h | 2 +- shared/dir_name.cpp | 5 +- shared/dir_name.h | 2 +- shared/dir_watcher.cpp | 31 +- shared/dir_watcher.h | 2 +- shared/dll_loader.cpp | 2 +- shared/dll_loader.h | 4 +- shared/dst_hack.cpp | 6 +- shared/file_drop.h | 2 +- shared/file_error.h | 4 +- shared/file_handling.cpp | 287 +++++-------- shared/file_handling.h | 14 +- shared/file_id.cpp | 5 +- shared/file_id.h | 2 +- shared/file_io.cpp | 2 +- shared/file_io.h | 2 +- shared/file_traverser.cpp | 56 ++- shared/file_traverser.h | 2 +- shared/file_update_handle.h | 67 +++ shared/global_func.h | 2 +- shared/guid.cpp | 2 +- shared/guid.h | 2 +- shared/help_provider.cpp | 2 +- shared/help_provider.h | 2 +- shared/i18n.h | 2 +- shared/int64.h | 2 +- shared/last_error.cpp | 2 +- shared/last_error.h | 2 +- shared/localization.cpp | 2 +- shared/localization.h | 2 +- shared/long_path_prefix.h | 2 +- shared/mouse_move_dlg.cpp | 2 +- shared/mouse_move_dlg.h | 2 +- shared/notify_removal.cpp | 6 +- shared/notify_removal.h | 2 +- shared/parse_lng.h | 2 +- shared/parse_plural.h | 2 +- shared/parse_txt.h | 2 +- shared/pch.h | 2 +- shared/perf.h | 2 +- shared/recycler.cpp | 92 ++-- shared/recycler.h | 15 +- shared/resolve_path.cpp | 47 +- shared/resolve_path.h | 2 +- shared/serialize.cpp | 2 +- shared/serialize.h | 2 +- shared/shadow.cpp | 29 +- shared/shadow.h | 2 +- shared/shell_execute.h | 32 +- shared/standard_paths.cpp | 2 +- shared/standard_paths.h | 2 +- shared/string_conv.h | 2 +- shared/symlink_target.h | 2 +- shared/taskbar.cpp | 106 ++++- shared/taskbar.h | 22 +- shared/toggle_button.cpp | 2 +- shared/toggle_button.h | 2 +- shared/util.cpp | 2 +- shared/util.h | 2 +- shared/warn_static.h | 35 ++ shared/wx_choice_enum.h | 2 +- shared/wx_timespan.h | 2 +- shared/xml_base.cpp | 7 +- shared/xml_base.h | 2 +- shared/xml_error.h | 2 +- shared/zbase.h | 68 +-- shared/zstring.cpp | 14 +- shared/zstring.h | 16 +- structures.cpp | 2 +- structures.h | 2 +- synchronization.cpp | 107 ++--- synchronization.h | 10 +- ui/batch_config.cpp | 2 +- ui/batch_config.h | 2 +- ui/batch_status_handler.cpp | 2 +- ui/batch_status_handler.h | 2 +- ui/check_version.cpp | 2 +- ui/check_version.h | 2 +- ui/folder_pair.h | 2 +- ui/grid_view.cpp | 2 +- ui/grid_view.h | 2 +- ui/gui_generated.cpp | 24 +- ui/gui_status_handler.cpp | 2 +- ui/gui_status_handler.h | 2 +- ui/main_dlg.cpp | 176 ++++---- ui/main_dlg.h | 14 +- ui/msg_popup.cpp | 2 +- ui/msg_popup.h | 2 +- ui/progress_indicator.cpp | 150 ++++--- ui/progress_indicator.h | 2 +- ui/search.cpp | 2 +- ui/search.h | 2 +- ui/small_dlgs.cpp | 2 +- ui/small_dlgs.h | 2 +- ui/sorting.h | 2 +- ui/switch_to_gui.cpp | 2 +- ui/switch_to_gui.h | 2 +- ui/sync_cfg.cpp | 2 +- ui/sync_cfg.h | 2 +- ui/tray_icon.cpp | 104 ++--- ui/tray_icon.h | 19 +- version/version.h | 2 +- version/version.rc | 4 +- 216 files changed, 3127 insertions(+), 2399 deletions(-) create mode 100644 library/dir_exist_async.h create mode 100644 library/parallel_scan.cpp create mode 100644 library/parallel_scan.h delete mode 100644 shared/check_exist.cpp create mode 100644 shared/file_update_handle.h create mode 100644 shared/warn_static.h diff --git a/Application.cpp b/Application.cpp index a9628646..dcd125bc 100644 --- a/Application.cpp +++ b/Application.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "application.h" #include "ui/main_dlg.h" #include @@ -286,7 +286,7 @@ void Application::runBatchMode(const wxString& filename, xmlAccess::XmlGlobalSet { const wxString soundFile = zen::getResourceDir() + wxT("Sync_Complete.wav"); if (fileExists(toZ(soundFile))) - wxSound::Play(soundFile, wxSOUND_ASYNC); //warning: this may fail and show a wxWidgets error message! + wxSound::Play(soundFile, wxSOUND_ASYNC); //warning: this may fail and show a wxWidgets error message! => must not play when running FFS as a service! } } catch (BatchAbortProcess&) //exit used by statusHandler diff --git a/Application.h b/Application.h index 79b4017d..d26fd59f 100644 --- a/Application.h +++ b/Application.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef FREEFILESYNCAPP_H #define FREEFILESYNCAPP_H diff --git a/BUILD/Changelog.txt b/BUILD/Changelog.txt index 36999147..b55ca854 100644 --- a/BUILD/Changelog.txt +++ b/BUILD/Changelog.txt @@ -2,10 +2,22 @@ |FreeFileSync| -------------- +Changelog v3.20 +--------------- +Scan multiple directories in parallel +Automatically resolve disconnected network maps +Fixed temporal hang when dropping large files on main dialog + mode: Fixed issue regarding directory names differing in case during first sync +Delete permanently if recycle bin is not available (Linux) +Keep FreeFileSync responsive when trying to access non-existent network folder +Support for Ubuntu Unity Launcher (Linux) +RealtimeSync: Failure notification if command line is invalid (Linux) + + Changelog v3.19 --------------- -Exclude directories from synchronization which cannot be accessed during comparison -Warning if Recycle Bin is not available instead of deleting silently +Exclude subdirectories from synchronization which cannot be accessed during comparison +Warning if Recycle Bin is not available instead of deleting silently (Windows) Adapted log message if missing recycler leads to permanent deletion (Windows) Revert to per file recycle bin handling if creating temp recycler folder fails Avoid orphaned deletion temp directories on network drives diff --git a/BUILD/FreeFileSync.chm b/BUILD/FreeFileSync.chm index b5c6039c..536b4cee 100644 Binary files a/BUILD/FreeFileSync.chm and b/BUILD/FreeFileSync.chm differ diff --git a/BUILD/Languages/chinese_simple.lng b/BUILD/Languages/chinese_simple.lng index 50dc50b5..3559ad38 100644 --- a/BUILD/Languages/chinese_simple.lng +++ b/BUILD/Languages/chinese_simple.lng @@ -7,6 +7,8 @@ 0 +Searching for directory %x... + Show in Explorer 在Explorer中显示 Open with default application @@ -17,8 +19,8 @@ 实时同步 - 自动同步 Browse 浏览 -Invalid commandline: "%x" -非法命令行:"%x" +Invalid commandline: %x +非法命令行:%x Error resolving symbolic link: 解决符号链接出错: Show popup @@ -108,10 +110,10 @@ 初始化同步: One of the FreeFileSync database files is not yet existing: FreeFileSync数据库文件其中一个不存在: -One of the FreeFileSync database entries within the following file is not yet existing: -以下文件中的FreeFileSync数据库入口其中一个不存在: Error reading from synchronization database: 从同步数据库中读取时出错: +Database files do not share a common synchronization session: + An exception occurred! 发生异常! Error deleting file: @@ -133,6 +135,15 @@ 信息 Fatal Error 致命错误 +Scanning: +扫描中: +Encoding extended time information: %x +正在编码扩展时间信息:%x + +[1 Thread] +[%x Threads] + + Invalid FreeFileSync config file! 无效的 FreeFileSync 配置文件! File does not exist: @@ -224,20 +235,18 @@ The command line is executed each time: 监视激活... Waiting for missing directories... 正在等待丢失的目录... -Could not initialize directory monitoring: -不能初始化目录监视: A directory input field is empty. 有一个目录输入字段是空的. -Error when monitoring directories. -监视目录时出错. Drag && drop 拖放 +Could not initialize directory monitoring: +不能初始化目录监视: +Error when monitoring directories. +监视目录时出错. Conversion error: 转换错误: Error moving file: 移动文件时出错: -Operation aborted! -操作已取消! Target file already existing! 目标文件已经存在! Error moving directory: @@ -268,6 +277,8 @@ The command line is executed each time: 写入文件出错: Error reading file: 读取文件出错: +Operation aborted! +操作已取消! Endless loop when traversing directory: 遍历目录时出现无限循环: Error traversing directory: @@ -408,24 +419,22 @@ The command line is executed each time: 为自动同步创建一个批处理. 要开始批处理模式只需简单地双击批处理文件或通过命令行执行:FreeFileSync.exe <批处理文件名>. 此外还可以通过操作系统的计划任务来定时执行. Help 帮助 -Configuration overview: -配置概览: Filter files 过滤文件 -Status feedback -状况反馈 -Silent mode -静默模式 -Start minimized and write status information to a logfile -以最小化开始运行并将信息写到日志文件 Error handling 错误处理 Overview 摘要 -Select logfile directory: -选择日志保存位置: +Status feedback +状况反馈 +Run minimized + Maximum number of logfiles: 最大的日志文件数: +Select logfile directory: +选择日志保存位置: +Batch settings + &Save 保存(&S) &Load @@ -691,10 +700,6 @@ Transfer file and directory permissions 文件夹对 Select view 选择视图 -Folder Comparison and Synchronization -文件夹比较与同步 -Recycle Bin not yet supported for this system! -此系统上不支持回收站! Set direction: 设置方向: Exclude temporarily @@ -729,6 +734,8 @@ Transfer file and directory permissions 保存更改到当前配置? Configuration loaded! 配置已加载! +Folder Comparison and Synchronization +文件夹比较与同步 Hide files that exist on left side only 隐藏仅在左侧的文件 Show files that exist on left side only @@ -931,10 +938,6 @@ Transfer file and directory permissions 设置默认的同步方向:旧文件会被新文件覆盖. The file does not contain a valid configuration: 该文件不包含有效的配置: -Scanning: -扫描中: -Encoding extended time information: %x -正在编码扩展时间信息:%x You can ignore this error to consider the directory as empty. 你可以忽略这个错误而认为目录是空的. Directory does not exist: @@ -1011,8 +1014,6 @@ Transfer file and directory permissions 更新 %x 的属性 Source directory does not exist anymore: 源目录已经不存在: -Generating database... -正在生成数据库... Nothing to synchronize according to configuration! 根据配置没有任何同步! Target directory name must not be empty! @@ -1033,10 +1034,14 @@ Transfer file and directory permissions 需要可用的磁盘空间: Free disk space available: 可用磁盘空间: +Recycle Bin is not available for the following paths! Files will be deleted permanently instead: + A directory will be modified which is part of multiple folder pairs! Please review synchronization settings! 有一个目录将被修改,而它是多个文件夹对的一部分!请重新检查同步设置! Processing folder pair: 正在处理成对文件夹: +Generating database... +正在生成数据库... Error copying locked file %x! 复制已锁定的文件时出错 %x! Data verification error: Source and target file have different content! diff --git a/BUILD/Languages/chinese_traditional.lng b/BUILD/Languages/chinese_traditional.lng index 54f3d843..9f1da986 100644 --- a/BUILD/Languages/chinese_traditional.lng +++ b/BUILD/Languages/chinese_traditional.lng @@ -7,6 +7,8 @@ 0 +Searching for directory %x... + Show in Explorer 在資源管理器中顯示 Open with default application @@ -17,8 +19,8 @@ 即時同步 - 自動同步 Browse 瀏覽 -Invalid commandline: "%x" -無效的命令列:"%x" +Invalid commandline: %x +無效的命令列:%x Error resolving symbolic link: 解析錯誤的符號連結: Show popup @@ -108,10 +110,10 @@ 初始化同步: One of the FreeFileSync database files is not yet existing: 其中一個 FreeFileSync 資料庫檔案不存在: -One of the FreeFileSync database entries within the following file is not yet existing: -以下資料庫條目的其中一個 FreeFileSync 檔案不存在: Error reading from synchronization database: 讀取同步資料庫錯誤: +Database files do not share a common synchronization session: + An exception occurred! 發生異常! Error deleting file: @@ -133,6 +135,15 @@ 訊息 Fatal Error 嚴重錯誤 +Scanning: +掃瞄中: +Encoding extended time information: %x +編碼延長時間資訊:%x + +[1 Thread] +[%x Threads] + + Invalid FreeFileSync config file! 無效的 FreeFileSync 配置檔案! File does not exist: @@ -224,20 +235,18 @@ The command line is executed each time: 監測活動... Waiting for missing directories... 等待缺少的目錄... -Could not initialize directory monitoring: -無法初始化目錄監測: A directory input field is empty. 目錄輸入的欄位為空 -Error when monitoring directories. -監測目錄錯誤。 Drag && drop 拖放 +Could not initialize directory monitoring: +無法初始化目錄監測: +Error when monitoring directories. +監測目錄錯誤。 Conversion error: 轉換錯誤: Error moving file: 移動檔案錯誤: -Operation aborted! -中止操作! Target file already existing! 目標檔案已存在! Error moving directory: @@ -268,6 +277,8 @@ The command line is executed each time: 寫入檔案錯誤: Error reading file: 讀取檔案錯誤: +Operation aborted! +中止操作! Endless loop when traversing directory: 當遍歷目錄時無限循環: Error traversing directory: @@ -408,24 +419,22 @@ The command line is executed each time: 新建一個自動同步的批次檔。若要開始批次處理模式只需按兩下此檔或通過命令列執行:FreeFileSync.exe 。還可以安排在您的作業系統的任務計畫中。 Help 說明 -Configuration overview: -配置概述: Filter files 篩選檔案 -Status feedback -狀態回報 -Silent mode -靜音模式 -Start minimized and write status information to a logfile -啟動最小化和寫入狀態資訊到日誌檔 Error handling 錯誤處理 Overview 摘要 -Select logfile directory: -選擇日誌檔目錄: +Status feedback +狀態回報 +Run minimized + Maximum number of logfiles: 日誌檔的最大數目: +Select logfile directory: +選擇日誌檔目錄: +Batch settings + &Save 儲存(&S) &Load @@ -682,10 +691,6 @@ Transfer file and directory permissions 資料夾對 Select view 選擇檢視 -Folder Comparison and Synchronization -資料夾比對和同步 -Recycle Bin not yet supported for this system! -資源回收筒尚未支援此系統! Set direction: 設定方向: Exclude temporarily @@ -720,6 +725,8 @@ Transfer file and directory permissions 要儲存目前配置的更改嗎? Configuration loaded! 已載入配置! +Folder Comparison and Synchronization +資料夾比對和同步 Hide files that exist on left side only 隱藏只存在於左邊的檔案 Show files that exist on left side only @@ -922,10 +929,6 @@ Transfer file and directory permissions 設定預設同步方向:舊檔案會被較新的檔案覆蓋。 The file does not contain a valid configuration: 該檔案不包含有效的配置: -Scanning: -掃瞄中: -Encoding extended time information: %x -編碼延長時間資訊:%x You can ignore this error to consider the directory as empty. 您可以忽略此錯誤,考慮該目錄為空。 Directory does not exist: @@ -1002,8 +1005,6 @@ Transfer file and directory permissions 更新 %x 個的屬性 Source directory does not exist anymore: 來源目錄不存在: -Generating database... -產生資料庫... Nothing to synchronize according to configuration! 根據配置没有任何同步! Target directory name must not be empty! @@ -1024,10 +1025,14 @@ Transfer file and directory permissions 所需要的可用磁碟空間: Free disk space available: 可用磁碟空間: +Recycle Bin is not available for the following paths! Files will be deleted permanently instead: + A directory will be modified which is part of multiple folder pairs! Please review synchronization settings! 一個目錄將被修改,這是多對資料夾的一部份!請檢閱同步設定! Processing folder pair: 處理一對資料夾: +Generating database... +產生資料庫... Error copying locked file %x! 複製已鎖定檔案錯誤 %x! Data verification error: Source and target file have different content! diff --git a/BUILD/Languages/czech.lng b/BUILD/Languages/czech.lng index 367221a2..223b3e6f 100644 --- a/BUILD/Languages/czech.lng +++ b/BUILD/Languages/czech.lng @@ -7,6 +7,8 @@ n==1 ? 0 : n>=2 && n<=4 ? 1 : 2 +Searching for directory %x... + Show in Explorer Zobrazit v Průzkumníkovi Open with default application @@ -17,8 +19,8 @@ RealtimeSync - Automatická synchronizace Browse Procházet -Invalid commandline: "%x" -Neplatný příkaz: "%x" +Invalid commandline: %x +Neplatný příkaz: %x Error resolving symbolic link: Chyba odkazu zástupce: Show popup @@ -110,10 +112,10 @@ Prvotní synchronizace: One of the FreeFileSync database files is not yet existing: Některý z databázových souborů FreeFileSync neexistuje: -One of the FreeFileSync database entries within the following file is not yet existing: -Některá z položek databáze FreeFileSync k následujícímu souboru ještě neexistuje: Error reading from synchronization database: Chyba čtení synchronizační databáze: +Database files do not share a common synchronization session: + An exception occurred! Vyskytla se chyba! Error deleting file: @@ -137,6 +139,15 @@ Info Fatal Error Závažná chyba +Scanning: +Zpracováváno: +Encoding extended time information: %x +Zpracování rozšířené informace o čase: %x + +[1 Thread] +[%x Threads] + + Invalid FreeFileSync config file! Chybný konfigurační soubor FreeFileSync! File does not exist: @@ -234,20 +245,18 @@ Příkazová řádka je spuštěna pokaždé když: Sledování zapnuto... Waiting for missing directories... Čekání na nedostupné adresáře... -Could not initialize directory monitoring: -Nelze nastavit monitorování adresáře: A directory input field is empty. Není zadán vstupní adresář. -Error when monitoring directories. -Chyba při sledování adresářů. Drag && drop Drag && Drop +Could not initialize directory monitoring: +Nelze nastavit monitorování adresáře: +Error when monitoring directories. +Chyba při sledování adresářů. Conversion error: Chyba konverze: Error moving file: Chyba přesouvání souboru: -Operation aborted! -Operace zrušena! Target file already existing! Cílový soubor již existuje! Error moving directory: @@ -278,6 +287,8 @@ Příkazová řádka je spuštěna pokaždé když: Chyba zápisu souboru: Error reading file: Chyba čtení souboru: +Operation aborted! +Operace zrušena! Endless loop when traversing directory: Zacyklení při procházení adresáře: Error traversing directory: @@ -418,24 +429,22 @@ Příkazová řádka je spuštěna pokaždé když: Vytvoří dávkový souboru pro automatický provoz. Ke spuštění dávky jednoduše poklikejte na vytvořený soubor nebo jejho jméno zadejte jako parametr při spuštění FreeFileSync: FreeFileSync.exe . Stejně tak můžete ke spuštění využít plánovač úloh vašeho operačního systému. Help Nápověda -Configuration overview: -Přehled konfigurace: Filter files Filtr souborů -Status feedback -Běh programu -Silent mode -Tichý mód -Start minimized and write status information to a logfile -Spustit minimalizovaný a zapisovat informace do záznamového souboru Error handling Zpracování chyb Overview Přehled -Select logfile directory: -Vyberte adresář pro záznamové soubory: +Status feedback +Běh programu +Run minimized + Maximum number of logfiles: Maximální počet záznamových soubor +Select logfile directory: +Vyberte adresář pro záznamové soubory: +Batch settings + &Save &Uložit &Load @@ -700,10 +709,6 @@ Přenést přístupová oprávnění souborů a adresářů Adresářové páry Select view Vyberte zobrazení -Folder Comparison and Synchronization -Porovnání a Synchronizace adresářů -Recycle Bin not yet supported for this system! -Koš není na tomto systému zatím podporován! Set direction: Nastavit adresář: Exclude temporarily @@ -738,6 +743,8 @@ Přenést přístupová oprávnění souborů a adresářů Uložit změny do aktuální konfigurace? Configuration loaded! Konfigurace načtena. +Folder Comparison and Synchronization +Porovnání a Synchronizace adresářů Hide files that exist on left side only Skrýt soubory existující pouze vlevo Show files that exist on left side only @@ -952,10 +959,6 @@ Přenést přístupová oprávnění souborů a adresářů Nastaven výchozí způsob synchronizace: Staré soubory budou nahrazeny novými. The file does not contain a valid configuration: Soubor neobsahuje platnou konfiguraci: -Scanning: -Zpracováváno: -Encoding extended time information: %x -Zpracování rozšířené informace o čase: %x You can ignore this error to consider the directory as empty. Tuto chybu můžete ignorovat a považovat neexistující adresář jako prázdný. Directory does not exist: @@ -1032,8 +1035,6 @@ Přenést přístupová oprávnění souborů a adresářů Aktualizace atributů souboru %x Source directory does not exist anymore: Zdrojový adresář již neexistuje: -Generating database... -Vytváření databáze... Nothing to synchronize according to configuration! Podle dané konfigurace není co synchronizovat! Target directory name must not be empty! @@ -1054,10 +1055,14 @@ Přenést přístupová oprávnění souborů a adresářů Požadované volné místo na disku: Free disk space available: Volné místo k dispozici: +Recycle Bin is not available for the following paths! Files will be deleted permanently instead: + A directory will be modified which is part of multiple folder pairs! Please review synchronization settings! Bude změně adresář, který je součástí adresářového páru vícenásobného porovnání! Prosím zkontrolujte si nastavení synchronizace! Processing folder pair: Zpracovávání adresářové páru: +Generating database... +Vytváření databáze... Error copying locked file %x! Chyba kopírování zamčeného souboru %x! Data verification error: Source and target file have different content! diff --git a/BUILD/Languages/danish.lng b/BUILD/Languages/danish.lng index 4c0c3f65..eb879c05 100644 --- a/BUILD/Languages/danish.lng +++ b/BUILD/Languages/danish.lng @@ -7,6 +7,8 @@ n == 1 ? 0 : 1 +Searching for directory %x... + Show in Explorer Vis i Explorer Open with default application @@ -17,8 +19,8 @@ RealtimeSynk - Automatisk Synkronisering Browse Gennemse -Invalid commandline: "%x" -Ugyldig kommando: "%x" +Invalid commandline: %x +Ugyldig kommando: %x Error resolving symbolic link: Error resolving symbolic link: Show popup @@ -109,10 +111,10 @@ Indledende synkronisering: One of the FreeFileSync database files is not yet existing: En af FreeFileSync database filerne findes ikke endnu: -One of the FreeFileSync database entries within the following file is not yet existing: -En af FreeFileSync database posterne i den følgende fil findes ikke endnu: Error reading from synchronization database: Fejl i læsning fra synkroniserings databasen: +Database files do not share a common synchronization session: + An exception occurred! En undtagelse er opstået! Error deleting file: @@ -135,6 +137,15 @@ Info Fatal Error Uoprettelig Fejl +Scanning: +Skanner: +Encoding extended time information: %x +Finder udvidet tids information: %x + +[1 Thread] +[%x Threads] + + Invalid FreeFileSync config file! Ugyldig FreeFileSync config fil! File does not exist: @@ -229,20 +240,18 @@ Kommando linjen bliver afviklet hver gang: Overvågning aktiv... Waiting for missing directories... Venter på manglende biblioteker... -Could not initialize directory monitoring: -Kunne ikke initialiserer biblioteks overvågningen: A directory input field is empty. Et biblioteks felt er tomt. -Error when monitoring directories. -Fejl i overvågning af biblioteker. Drag && drop Træk && slip +Could not initialize directory monitoring: +Kunne ikke initialiserer biblioteks overvågningen: +Error when monitoring directories. +Fejl i overvågning af biblioteker. Conversion error: Konverterings fejl: Error moving file: Fejl i flytning af fil: -Operation aborted! -Operation afbrudt! Target file already existing! Filen findes i forvejen! Error moving directory: @@ -273,6 +282,8 @@ Kommando linjen bliver afviklet hver gang: Fejl i at skrive fil: Error reading file: Fejl i læsning af fil: +Operation aborted! +Operation afbrudt! Endless loop when traversing directory: Uendelig løkke ved gennemgang af bibliotek: Error traversing directory: @@ -413,24 +424,22 @@ Kommando linjen bliver afviklet hver gang: Opret en batch fil til automatisk synkronisering. For at starte i batch mode dobbelt-click på filen eller afvikle med kommandoen: FreeFileSync.exe . Dette kan også planlægges i dit systems opgavestyring. Help Hjælp -Configuration overview: -Overblik over konfiguration: Filter files Filter filer -Status feedback -Status feedback -Silent mode -Lydløs tilstand -Start minimized and write status information to a logfile -Start minimeret og skriv status information til en log fil Error handling Fejl håndtering Overview Overblik -Select logfile directory: -Vælg log fil bibliotek: +Status feedback +Status feedback +Run minimized + Maximum number of logfiles: Maksimalt antal log filer: +Select logfile directory: +Vælg log fil bibliotek: +Batch settings + &Save &Gem &Load @@ -695,10 +704,6 @@ Overfør fil og biblioteks tilladelser Mappe par Select view Vælg udseende -Folder Comparison and Synchronization -Mappe sammenligning og synkronisering -Recycle Bin not yet supported for this system! -Skraldespanden er ikke understøttet for dette system endnu! Set direction: Sæt handlevejen: Exclude temporarily @@ -733,6 +738,8 @@ Overfør fil og biblioteks tilladelser Gem ændringer til nuværende konfiguration? Configuration loaded! Konfiguration hentet! +Folder Comparison and Synchronization +Mappe sammenligning og synkronisering Hide files that exist on left side only Skjul filder der kun findes på venstre side Show files that exist on left side only @@ -941,10 +948,6 @@ Overfør fil og biblioteks tilladelser Sætter standard synkroniseringsvej: Gamle filer bliver overskrevet med nyere. The file does not contain a valid configuration: Filen indeholder ikke en gyldig konfiguration: -Scanning: -Skanner: -Encoding extended time information: %x -Finder udvidet tids information: %x You can ignore this error to consider the directory as empty. Du kan ignorer denne fejl, og opfatte biblioteket som tomt. Directory does not exist: @@ -1021,8 +1024,6 @@ Overfør fil og biblioteks tilladelser Opdaterer attributter af %x Source directory does not exist anymore: Kilde biblioteket findes ikke mere: -Generating database... -Opretter database... Nothing to synchronize according to configuration! Intet at synkroniserer ifølge dokumentationen! Target directory name must not be empty! @@ -1043,10 +1044,14 @@ Overfør fil og biblioteks tilladelser Krævet ledig diskplads: Free disk space available: Ledig diskplads tilgængelig: +Recycle Bin is not available for the following paths! Files will be deleted permanently instead: + A directory will be modified which is part of multiple folder pairs! Please review synchronization settings! Et bibliotek vil blive ændret som er en del af et mappe par! Gennemse venligst synkroniserings indstillingerne! Processing folder pair: Behandler mappe par: +Generating database... +Opretter database... Error copying locked file %x! Fejl i kopiering af låst fil %x! Data verification error: Source and target file have different content! diff --git a/BUILD/Languages/dutch.lng b/BUILD/Languages/dutch.lng index f7000f4d..eea01f72 100644 --- a/BUILD/Languages/dutch.lng +++ b/BUILD/Languages/dutch.lng @@ -7,6 +7,8 @@ n == 1 ? 0 : 1 +Searching for directory %x... + Show in Explorer Toon in de verkenner Open with default application @@ -17,8 +19,8 @@ RealtimeSync - Geautomatiseerde Synchronisatie Browse Verkennen -Invalid commandline: "%x" -Ongeldige invoer: "%x" +Invalid commandline: %x +Ongeldige invoer: %x Error resolving symbolic link: Fout tijdens opzoeken van symbolische koppeling: Show popup @@ -109,10 +111,10 @@ Initiële synchronisatie: One of the FreeFileSync database files is not yet existing: Eén van de FreeFileSync database bestanden bestaat nog niet: -One of the FreeFileSync database entries within the following file is not yet existing: -Eén van de FreeFileSync database ingangen van het volgende bestand bestaat nog niet: Error reading from synchronization database: Fout tijdens uitlezen van synchronisatie-database: +Database files do not share a common synchronization session: + An exception occurred! Er heeft een uitzondering plaatsgevonden! Error deleting file: @@ -135,6 +137,15 @@ Info Fatal Error Fatale fout +Scanning: +Doorzoekt: +Encoding extended time information: %x +Coderen uitgebreide tijd informatie: %x + +[1 Thread] +[%x Threads] + + Invalid FreeFileSync config file! Foutief FreeFileSync configuratiebestand! File does not exist: @@ -229,20 +240,18 @@ De opdrachtregel wordt telkens uitgevoerd indien: Observeren actief... Waiting for missing directories... Wacht op missende mappen... -Could not initialize directory monitoring: -Initaliseren van map-observatie niet mogelijk: A directory input field is empty. Een tekstveld over de map is leeg. -Error when monitoring directories. -Fout tijdens observeren van mappen. Drag && drop Drag en drop +Could not initialize directory monitoring: +Initaliseren van map-observatie niet mogelijk: +Error when monitoring directories. +Fout tijdens observeren van mappen. Conversion error: Converteer fout: Error moving file: Fout tijdens verplaatsen van bestand: -Operation aborted! -Bewerking afgebroken! Target file already existing! Doelbestand bestaat al! Error moving directory: @@ -273,6 +282,8 @@ De opdrachtregel wordt telkens uitgevoerd indien: Fout tijdens schrijven van bestand: Error reading file: Fout tijdens lezen van bestand: +Operation aborted! +Bewerking afgebroken! Endless loop when traversing directory: Oneindige lus bij het doorlopen van map: Error traversing directory: @@ -413,24 +424,22 @@ De opdrachtregel wordt telkens uitgevoerd indien: Creëer een taakbestand voor geautomatiseerde synchronisatie. Om te starten in taakmodus dubbelklik op het bestand of uitvoeren via opdrachtregel: FreeFileSync.exe . Dit kan ook gepland worden met de taakplanner van uw OS. Help Help -Configuration overview: -Configuratie overzicht: Filter files Filter bestanden -Status feedback -Status terugkoppeling -Silent mode -Stille modus -Start minimized and write status information to a logfile -Start geminimaliseerd en schrijf status informatie naar een logbestand Error handling Fout afhandeling Overview Overzicht -Select logfile directory: -Selecteer een map voor het logbestand: +Status feedback +Status terugkoppeling +Run minimized + Maximum number of logfiles: Maximale aantal van logbestanden: +Select logfile directory: +Selecteer een map voor het logbestand: +Batch settings + &Save &Opslaan &Load @@ -694,11 +703,7 @@ Zet bestand en map permissies over Folder pairs Map paren Select view -Kies kijk -Folder Comparison and Synchronization -Mappen vergelijken en synchroniseren -Recycle Bin not yet supported for this system! -Prullenbak is op dit systeem nog niet ondersteund! +Kies weergave Set direction: Stel richting in: Exclude temporarily @@ -733,6 +738,8 @@ Zet bestand en map permissies over Veranderingen opslaan in de huidige configuratie? Configuration loaded! Configuratie geladen! +Folder Comparison and Synchronization +Mappen vergelijken en synchroniseren Hide files that exist on left side only Verberg bestanden die alleen aan de linkerzijde bestaan Show files that exist on left side only @@ -941,10 +948,6 @@ Zet bestand en map permissies over Stel standaard synchronisatie richtingen in: Oude bestanden worden door nieuwere bestanden overschreven. The file does not contain a valid configuration: Het bestand bevat geen geldige configuratie: -Scanning: -Doorzoekt: -Encoding extended time information: %x -Coderen uitgebreide tijd informatie: %x You can ignore this error to consider the directory as empty. Je kan deze error negeren als de map leeg is. Directory does not exist: @@ -1021,8 +1024,6 @@ Zet bestand en map permissies over Attributen bijwerken van %x Source directory does not exist anymore: Bronmap bestaat niet meer: -Generating database... -Genereren van database... Nothing to synchronize according to configuration! Volgens de configuratie hoeft er niets gesynchroniseerd te worden! Target directory name must not be empty! @@ -1043,10 +1044,14 @@ Zet bestand en map permissies over Vrije ruimte op harde schrijf nodig: Free disk space available: Beschikbare vrije schijfruimte : +Recycle Bin is not available for the following paths! Files will be deleted permanently instead: + A directory will be modified which is part of multiple folder pairs! Please review synchronization settings! Een map wordt bewerkt die deel is van meerdere mappen! Controleer de synchronisatie instellingen! Processing folder pair: Verwerking van gekoppelde mappen: +Generating database... +Genereren van database... Error copying locked file %x! Fout tijdens kopiëren van vergrendeld bestand %x! Data verification error: Source and target file have different content! diff --git a/BUILD/Languages/english_uk.lng b/BUILD/Languages/english_uk.lng index c2c776f9..fb0f9ee6 100644 --- a/BUILD/Languages/english_uk.lng +++ b/BUILD/Languages/english_uk.lng @@ -7,6 +7,8 @@ n == 1 ? 0 : 1 +Searching for directory %x... +Searching for directory %x... Show in Explorer Show in Explorer Open with default application @@ -17,8 +19,8 @@ RealtimeSync - Automated Synchronisation Browse Browse -Invalid commandline: "%x" -Invalid commandline: "%x" +Invalid commandline: %x +Invalid commandline: %x Error resolving symbolic link: Error resolving symbolic link: Show popup @@ -109,10 +111,10 @@ Initial synchronisation: One of the FreeFileSync database files is not yet existing: One of the FreeFileSync database files is not yet existing: -One of the FreeFileSync database entries within the following file is not yet existing: -One of the FreeFileSync database entries within the following file is not yet existing: Error reading from synchronization database: Error reading from synchronisation database: +Database files do not share a common synchronization session: +Database files do not share a common synchronisation session: An exception occurred! An exception occurred! Error deleting file: @@ -135,6 +137,18 @@ Info Fatal Error Fatal Error +Scanning: +Scanning: +Encoding extended time information: %x +Encoding extended time information: %x + +[1 Thread] +[%x Threads] + + +[1 Thread] +[%x Threads] + Invalid FreeFileSync config file! Invalid FreeFileSync config file! File does not exist: @@ -229,20 +243,18 @@ The command line is executed each time: Monitoring active... Waiting for missing directories... Waiting for missing directories... -Could not initialize directory monitoring: -Could not initialise directory monitoring: A directory input field is empty. A directory input field is empty. -Error when monitoring directories. -Error when monitoring directories. Drag && drop Drag && drop +Could not initialize directory monitoring: +Could not initialise directory monitoring: +Error when monitoring directories. +Error when monitoring directories. Conversion error: Conversion error: Error moving file: Error moving file: -Operation aborted! -Operation aborted! Target file already existing! Target file already existing! Error moving directory: @@ -273,6 +285,8 @@ The command line is executed each time: Error writing file: Error reading file: Error reading file: +Operation aborted! +Operation aborted! Endless loop when traversing directory: Endless loop when traversing directory: Error traversing directory: @@ -413,24 +427,22 @@ The command line is executed each time: Create a batch file for automated synchronisation. To start in batch mode simply double-click the file or execute via command line: FreeFileSync.exe . This can also be scheduled in your operating system's task planner. Help Help -Configuration overview: -Configuration overview: Filter files Filter files -Status feedback -Status feedback -Silent mode -Silent mode -Start minimized and write status information to a logfile -Start minimized and write status information to a logfile Error handling Error handling Overview Overview -Select logfile directory: -Select logfile directory: +Status feedback +Status feedback +Run minimized +Run minimised Maximum number of logfiles: Maximum number of logfiles: +Select logfile directory: +Select logfile directory: +Batch settings +Batch settings &Save &Save &Load @@ -695,10 +707,6 @@ Transfer file and directory permissions Folder pairs Select view Select view -Folder Comparison and Synchronization -Folder Comparison and Synchronisation -Recycle Bin not yet supported for this system! -Recycle Bin not yet supported for this system! Set direction: Set direction: Exclude temporarily @@ -733,6 +741,8 @@ Transfer file and directory permissions Save changes to current configuration? Configuration loaded! Configuration loaded! +Folder Comparison and Synchronization +Folder Comparison and Synchronisation Hide files that exist on left side only Hide files that exist on left side only Show files that exist on left side only @@ -941,10 +951,6 @@ Transfer file and directory permissions Setting default synchronisation directions: Old files will be overwritten with newer files. The file does not contain a valid configuration: The file does not contain a valid configuration: -Scanning: -Scanning: -Encoding extended time information: %x -Encoding extended time information: %x You can ignore this error to consider the directory as empty. You can ignore this error to consider the directory as empty. Directory does not exist: @@ -1021,8 +1027,6 @@ Transfer file and directory permissions Updating attributes of %x Source directory does not exist anymore: Source directory does not exist anymore: -Generating database... -Generating database... Nothing to synchronize according to configuration! Nothing to synchronise according to configuration! Target directory name must not be empty! @@ -1043,10 +1047,14 @@ Transfer file and directory permissions Free disk space required: Free disk space available: Free disk space available: +Recycle Bin is not available for the following paths! Files will be deleted permanently instead: +Recycle Bin is not available for the following paths! Files will be deleted permanently instead: A directory will be modified which is part of multiple folder pairs! Please review synchronization settings! A directory will be modified which is part of multiple folder pairs! Please review synchronisation settings! Processing folder pair: Processing folder pair: +Generating database... +Generating database... Error copying locked file %x! Error copying locked file %x! Data verification error: Source and target file have different content! diff --git a/BUILD/Languages/finnish.lng b/BUILD/Languages/finnish.lng index a0ddf34a..286c889b 100644 --- a/BUILD/Languages/finnish.lng +++ b/BUILD/Languages/finnish.lng @@ -7,6 +7,8 @@ n == 1 ? 0 : 1 +Searching for directory %x... + Show in Explorer Näytä Explorerissa Open with default application @@ -17,8 +19,8 @@ RealtimeSync - Automaattinen täsmäytys Browse Selaa -Invalid commandline: "%x" -Virheellinen komento: "%x" +Invalid commandline: %x +Virheellinen komento: %x Error resolving symbolic link: Virhe selvittäessä symbolista linkkiä: Show popup @@ -109,10 +111,10 @@ Ensi täsmäytys: One of the FreeFileSync database files is not yet existing: Jokin FreeFileSynk tietokannan tiedostoista puuttuu vielä: -One of the FreeFileSync database entries within the following file is not yet existing: -Jokin FreeFileSynk tietokannan olioista puuttuu vielä tiedostossa: Error reading from synchronization database: Virhe lukiessa täsmäytyksen tietokantaa: +Database files do not share a common synchronization session: + An exception occurred! Virhe havaittu! Error deleting file: @@ -135,6 +137,15 @@ Info Fatal Error Kohtalokas virhe +Scanning: +Haen: +Encoding extended time information: %x +Tulkitaan laajennettua aikatietoa: %x + +[1 Thread] +[%x Threads] + + Invalid FreeFileSync config file! Virheellinen FreeFileSync asetustiedosto! File does not exist: @@ -229,20 +240,18 @@ Komento suoritetaan kun: Seuranta käynnissä... Waiting for missing directories... Odottaa puuttuvia hakemistoja... -Could not initialize directory monitoring: -Hakemiston tarkkailua ei voitu käynnistää: A directory input field is empty. Hekemistokenttä on tyhjä. -Error when monitoring directories. -Virhe seuratessa hakemistoa. Drag && drop Vedä ja pudota +Could not initialize directory monitoring: +Hakemiston tarkkailua ei voitu käynnistää: +Error when monitoring directories. +Virhe seuratessa hakemistoa. Conversion error: Konversio virhe: Error moving file: Virhe siirtäessä tiedostoa: -Operation aborted! -Toiminto lopetettiin! Target file already existing! Kohde tiedosto on jo olemassa! Error moving directory: @@ -273,6 +282,8 @@ Komento suoritetaan kun: Virhe kirjottaessa tiedostoa: Error reading file: Virhe lukiessa tiedostoa: +Operation aborted! +Toiminto lopetettiin! Endless loop when traversing directory: Suorita hakemiston läpikulku jatkuvana: Error traversing directory: @@ -413,24 +424,22 @@ Komento suoritetaan kun: Luo automaattisen täsmäytyksen eräajotiedosto. Käynnistä se kaksois klikillä tai komennolla: FreeFileSync.exe . Käyttöjärjestelmän tehtävien ajoitustoiminnolla voit ajastaa suorittaminen. Help Ohje -Configuration overview: -Asetukset: Filter files Suodata tiedostoja -Status feedback -Tilan palaute -Silent mode -Hiljainen suoritus -Start minimized and write status information to a logfile -Käynnistä minimoituna ja kirjoita statukset lokiin Error handling Virhe käsitellessä Overview Yleiskatsaus -Select logfile directory: -Hakemisto lokitiedostoille: +Status feedback +Tilan palaute +Run minimized + Maximum number of logfiles: Lokitiedostojen enimmäismäärä: +Select logfile directory: +Hakemisto lokitiedostoille: +Batch settings + &Save &Tallenna &Load @@ -695,10 +704,6 @@ Siirrä tiedosto- ja hekimisto-oikeuksia Hakemistoparit Select view Valitse näkymä -Folder Comparison and Synchronization -Hakemistojen vertailu ja täsmäytys -Recycle Bin not yet supported for this system! -Tämä järjestelmä ei vielä tue Roskakoria! Set direction: Aseta suunta: Exclude temporarily @@ -733,6 +738,8 @@ Siirrä tiedosto- ja hekimisto-oikeuksia Tallenna asetuksiin tehdyt muutokset? Configuration loaded! Asetukset ladattu! +Folder Comparison and Synchronization +Hakemistojen vertailu ja täsmäytys Hide files that exist on left side only Piilota vain vasemmalla olevat tiedostot Show files that exist on left side only @@ -941,10 +948,6 @@ Siirrä tiedosto- ja hekimisto-oikeuksia Aseta oletettu suunta täsmäytykselle: Vanhat tiedostot ylikirjoitetaan uudemilla tiedostoilla. The file does not contain a valid configuration: Asetustiedosto ei ole kelvollinen: -Scanning: -Haen: -Encoding extended time information: %x -Tulkitaan laajennettua aikatietoa: %x You can ignore this error to consider the directory as empty. Jätää virhe huomiotta ja tulkitse hakemisto tyhjäksi. Directory does not exist: @@ -1021,8 +1024,6 @@ Siirrä tiedosto- ja hekimisto-oikeuksia Päivitän %x:n ominaisuudet Source directory does not exist anymore: Lähdehakemisto puuttuu: -Generating database... -Luodaan tietokantaa... Nothing to synchronize according to configuration! Asetusten mukaan ei löydy täsmäytettävää! Target directory name must not be empty! @@ -1043,10 +1044,14 @@ Siirrä tiedosto- ja hekimisto-oikeuksia Tarvittava vapaa levytila: Free disk space available: Levytilaa jäljellä: +Recycle Bin is not available for the following paths! Files will be deleted permanently instead: + A directory will be modified which is part of multiple folder pairs! Please review synchronization settings! Moniosaisen hakemistoparin hakemisto muutetaan! Tarkista täsmäytys asetuksia! Processing folder pair: Käsitellään hakemistoparia: +Generating database... +Luodaan tietokantaa... Error copying locked file %x! Virhe kopioitaessa lukittua tiedostoa %x! Data verification error: Source and target file have different content! diff --git a/BUILD/Languages/french.lng b/BUILD/Languages/french.lng index 261503f3..b2a1ceed 100644 --- a/BUILD/Languages/french.lng +++ b/BUILD/Languages/french.lng @@ -7,6 +7,8 @@ n <= 1 ? 0 : 1 +Searching for directory %x... + Show in Explorer Montrer dans l'explorateur Open with default application @@ -17,8 +19,8 @@ RealtimeSync - Synchronisation Automatisée Browse Parcourir -Invalid commandline: "%x" -Ligne de commande invalide: "%x" +Invalid commandline: %x +Ligne de commande invalide: %x Error resolving symbolic link: Erreur lors de la résolution du lien symbolique : Show popup @@ -109,10 +111,10 @@ Première synchronisation : One of the FreeFileSync database files is not yet existing: L'un des fichiers de la base de données FreeFileSync n'existe plus : -One of the FreeFileSync database entries within the following file is not yet existing: -L'une des entrées de la base de données FreeFileSync n'existe plus dans le fichier : Error reading from synchronization database: Erreur lors de la lecture de la base de données de synchro : +Database files do not share a common synchronization session: + An exception occurred! Une erreur s'est produite ! Error deleting file: @@ -135,6 +137,15 @@ Info Fatal Error Erreur Fatale +Scanning: +Lecture en cours : +Encoding extended time information: %x +Codage de l'heure au format étendu : %x + +[1 Thread] +[%x Threads] + + Invalid FreeFileSync config file! Fichier de configuration FreeFileSync invalide ! File does not exist: @@ -229,20 +240,18 @@ La ligne de commande est exécutée chaque fois que : Surveillance en cours... Waiting for missing directories... En attente des répertoires absents ... -Could not initialize directory monitoring: -Impossible d'initialiser la surveillance des dossiers : A directory input field is empty. Un champ répertoire est vide -Error when monitoring directories. -Erreur lors de la surveillance des répertoires. Drag && drop Glisser && Déposer +Could not initialize directory monitoring: +Impossible d'initialiser la surveillance des dossiers : +Error when monitoring directories. +Erreur lors de la surveillance des répertoires. Conversion error: Erreur de conversion : Error moving file: Erreur lors du déplacement du fichier : -Operation aborted! -Opération abandonnée ! Target file already existing! Le fichier de destination existe déjà ! Error moving directory: @@ -273,6 +282,8 @@ La ligne de commande est exécutée chaque fois que : Erreur lors de l'écriture du fichier : Error reading file: Erreur lors de la lecture du fichier : +Operation aborted! +Opération abandonnée ! Endless loop when traversing directory: Boucle sans fin lors du parcours du répertoire : Error traversing directory: @@ -413,24 +424,22 @@ La ligne de commande est exécutée chaque fois que : Créer un fichier de commandes pour la synchronisation automatique. Pour démarrer en mode batch il suffit de double-cliquez sur le fichier de commandes ou d'exécuter en ligne de commande: FreeFileSync.exe . Vous pouvez aussi le programmer à l'aide du planificateur de tâches de votre système d'exploitation. Help Aide -Configuration overview: -Contrôle des paramètres : Filter files Filtrage des fichiers -Status feedback -Retour d'informations -Silent mode -Mode silencieux -Start minimized and write status information to a logfile -Démarrage en mode réduit et écriture des informations d'état dans un fichier log Error handling Erreur de gestion de fichiers Overview Présentation -Select logfile directory: -Choisissez un dossier pour le fichier .log : +Status feedback +Retour d'informations +Run minimized + Maximum number of logfiles: Nombre maximum de fichiers Log +Select logfile directory: +Choisissez un dossier pour le fichier .log : +Batch settings + &Save &Sauvegarder &Load @@ -695,10 +704,6 @@ Transfert des attributs système des fichiers et des répertoires Paires de dossiers Select view Choisissez une vue -Folder Comparison and Synchronization -Comparaison de dossiers et Synchronisation -Recycle Bin not yet supported for this system! -La Corbeille n'est pas supportée par ce système ! Set direction: Choix de la direction : Exclude temporarily @@ -733,6 +738,8 @@ Transfert des attributs système des fichiers et des répertoires Voulez-vous enregistrer les modifications dans la configuration actuelle ? Configuration loaded! Configuration chargée ! +Folder Comparison and Synchronization +Comparaison de dossiers et Synchronisation Hide files that exist on left side only Masquer les fichiers n'existant qu'à gauche Show files that exist on left side only @@ -941,10 +948,6 @@ Transfert des attributs système des fichiers et des répertoires Directions de la synchronisation par défaut : les anciens fichiers seront remplacés par les nouveaux. The file does not contain a valid configuration: Le fichier ne contient pas de configuration valide : -Scanning: -Lecture en cours : -Encoding extended time information: %x -Codage de l'heure au format étendu : %x You can ignore this error to consider the directory as empty. Vous pouvez ignorer cette erreur en considérant le répertoire comme vide. Directory does not exist: @@ -1021,8 +1024,6 @@ Transfert des attributs système des fichiers et des répertoires Mise à jour des attributs de %x Source directory does not exist anymore: Le répertoire source n'existe plus : -Generating database... -Génération de la base de données... Nothing to synchronize according to configuration! Rien à synchroniser dans cette configuration ! Target directory name must not be empty! @@ -1043,10 +1044,14 @@ Transfert des attributs système des fichiers et des répertoires Espace disque nécessaire : Free disk space available: Espace disque disponible : +Recycle Bin is not available for the following paths! Files will be deleted permanently instead: + A directory will be modified which is part of multiple folder pairs! Please review synchronization settings! Un répertoire faisant partie de paires multiples doit être modifié ! Vérifiez les paramètres de la synchronisation ! Processing folder pair: Traitement de la paire de dossiers : +Generating database... +Génération de la base de données... Error copying locked file %x! Erreur lors de la copie du fichier verrouillé %x ! Data verification error: Source and target file have different content! diff --git a/BUILD/Languages/german.lng b/BUILD/Languages/german.lng index b9e4ffe2..5aff5c15 100644 --- a/BUILD/Languages/german.lng +++ b/BUILD/Languages/german.lng @@ -7,6 +7,8 @@ n == 1 ? 0 : 1 +Searching for directory %x... +Suche Verzeichnis %x... Show in Explorer Im Explorer anzeigen Open with default application @@ -17,8 +19,8 @@ RealtimeSync - Automatisierte Synchronisation Browse Auswählen -Invalid commandline: "%x" -Ungültige Befehlszeile: "%x" +Invalid commandline: %x +Ungültige Befehlszeile: %x Error resolving symbolic link: Fehler beim Auflösen des Symbolischen Links: Show popup @@ -111,8 +113,8 @@ Eine der FreeFileSync Datenbankdateien existiert noch nicht: Error reading from synchronization database: Fehler beim Lesen der Synchronisationsdatenbank: -No matching synchronization session found in database files: - +Database files do not share a common synchronization session: +Die Datenbankdateien enthalten keine gemeinsame Synchronisationssitzung: An exception occurred! Eine Ausnahme ist aufgetreten! Error deleting file: @@ -135,6 +137,18 @@ Info Fatal Error Schwerer Fehler +Scanning: +Suche Dateien: +Encoding extended time information: %x +Speichere erweiterte Zeitinformation: %x + +[1 Thread] +[%x Threads] + + +[1 Thread] +[%x Threads] + Invalid FreeFileSync config file! Ungültige FreeFileSync Konfigurationsdatei! File does not exist: @@ -229,20 +243,18 @@ Die Befehlszeile wird ausgeführt wenn: Überwachung aktiv... Waiting for missing directories... Warte auf fehlende Verzeichnisse... -Could not initialize directory monitoring: -Die Verzeichnisüberwachung konnte nicht gestartet werden: A directory input field is empty. Ein Verzeichniseingabefeld ist leer. -Error when monitoring directories. -Fehler beim Überwachen der Verzeichnisse. Drag && drop Drag && Drop +Could not initialize directory monitoring: +Die Verzeichnisüberwachung konnte nicht gestartet werden: +Error when monitoring directories. +Fehler beim Überwachen der Verzeichnisse. Conversion error: Fehler bei Konvertierung: Error moving file: Fehler beim Verschieben der Datei: -Operation aborted! -Vorgang abgebrochen! Target file already existing! Die Zieldatei existiert bereits! Error moving directory: @@ -273,6 +285,8 @@ Die Befehlszeile wird ausgeführt wenn: Fehler beim Schreiben der Datei: Error reading file: Fehler beim Lesen der Datei: +Operation aborted! +Vorgang abgebrochen! Endless loop when traversing directory: Endlosschleife beim Lesen des Verzeichnisses: Error traversing directory: @@ -410,27 +424,25 @@ Die Befehlszeile wird ausgeführt wenn: Batch job Batch-Job Create a batch file for automated synchronization. To start in batch mode simply double-click the file or execute via command line: FreeFileSync.exe . This can also be scheduled in your operating system's task planner. -Erzeuge eine Batchdatei für die automatisierte Synchronisation. Um den Batch-Modus zu starten, einfach auf die Datei doppelklicken oder über die Befehlszeile ausführen: FreeFileSync.exe . Dies kann auch in den Taskplaner des Betriebssystems eingetragen werden. +Erzeuge eine Batchdatei für die automatisierte Synchronisation. Um den Batchmodus zu starten, einfach auf die Datei doppelklicken oder über die Befehlszeile ausführen: FreeFileSync.exe . Dies kann auch in den Taskplaner des Betriebssystems eingetragen werden. Help Hilfe -Configuration overview: -Konfigurationsübersicht: Filter files Dateien filtern -Status feedback -Statusrückmeldung -Silent mode -Stiller Modus -Start minimized and write status information to a logfile -Minimiert starten und Statusinformationen in eine Logdatei schreiben Error handling Fehlerbehandlung Overview Übersicht -Select logfile directory: -Verzeichnis für Logdatei wählen: +Status feedback +Statusrückmeldung +Run minimized +Minimiert ausführen Maximum number of logfiles: Maximale Anzahl an Logdateien: +Select logfile directory: +Verzeichnis für Logdatei wählen: +Batch settings +Batch Einstellungen &Save &Speichern &Load @@ -884,7 +896,7 @@ Transfer file and directory permissions Follow Folgen Integrate external applications into context menu. The following macros are available: -Integriert externe Anwendungen in das Kontextmenu. Die folgenden Makros stehen zur Verfügung: +Integriert externe Anwendungen in das Kontextmenü. Die folgenden Makros stehen zur Verfügung: - full file or directory name - kompletter Datei oder Verzeichnisname - directory part only @@ -939,10 +951,6 @@ Transfer file and directory permissions Setze Standardwerte für Synchronisationsrichtungen: Alte Dateien werden durch neuere überschrieben. The file does not contain a valid configuration: Die Datei enthält keine gültige Konfiguration: -Scanning: -Suche Dateien: -Encoding extended time information: %x -Speichere erweiterte Zeitinformation: %x You can ignore this error to consider the directory as empty. Dieser Fehler kann ignoriert werden, um das Verzeichnis als leer anzusehen. Directory does not exist: @@ -1019,8 +1027,6 @@ Transfer file and directory permissions Aktualisiere Attribute von %x Source directory does not exist anymore: Quellverzeichnis existiert nicht mehr: -Generating database... -Erzeuge Synchronisationsdatenbank... Nothing to synchronize according to configuration! Nichts zu synchronisieren gemäß den aktuellen Einstellungen! Target directory name must not be empty! @@ -1042,11 +1048,13 @@ Transfer file and directory permissions Free disk space available: Verfügbarer freier Speicherplatz: Recycle Bin is not available for the following paths! Files will be deleted permanently instead: - +Der Papierkorb ist auf nachfolgenden Verzeichnissen nicht verfügbar! Die Dateien werden stattdessen permanent gelöscht: A directory will be modified which is part of multiple folder pairs! Please review synchronization settings! Es wird ein Verzeichnis verändert werden, das Teil mehrerer Verzeichnispaare ist! Bitte die Synchronisationseinstellungen prüfen! Processing folder pair: Bearbeite Verzeichnispaar: +Generating database... +Erzeuge Synchronisationsdatenbank... Error copying locked file %x! Fehler beim Kopieren der gesperrten Datei %x! Data verification error: Source and target file have different content! diff --git a/BUILD/Languages/greek.lng b/BUILD/Languages/greek.lng index 5cd4ca4c..99c02a4e 100644 --- a/BUILD/Languages/greek.lng +++ b/BUILD/Languages/greek.lng @@ -7,6 +7,8 @@ n == 1 ? 0 : 1 +Searching for directory %x... + Show in Explorer Εμφάνιση στην Εξερεύνηση Open with default application @@ -17,8 +19,8 @@ RealtimeSync - Αυτοματοποιημένος Συγχρονισμός Browse Αναζήτηση -Invalid commandline: "%x" -Εσφαλμένη εντολή: "%x" +Invalid commandline: %x +Εσφαλμένη εντολή: %x Error resolving symbolic link: Σφάλμα κατά την επίλυση του συμβολικού δεσμού: Show popup @@ -109,10 +111,10 @@ Αρχικός συγχρονισμός: One of the FreeFileSync database files is not yet existing: Μια από τις βάσεις δεδομένων του FreeFileSync δεν υπάρχει ακόμα: -One of the FreeFileSync database entries within the following file is not yet existing: -Μια από τις εγγραφές στη βάση δεδομένων του FreeFileSync σχετικά με το ακόλουθο αρχείο δεν υπάρχει ακόμη: Error reading from synchronization database: Σφάλμα κατά την ανάγνωση από τη βάση δεδομένων συγχρονισμού: +Database files do not share a common synchronization session: + An exception occurred! Παρουσιάστηκε σφάλμα! Error deleting file: @@ -135,6 +137,15 @@ Πληροφορίες Fatal Error Σημαντικό Σφάλμα +Scanning: +Ανίχνευση: +Encoding extended time information: %x +Κωδικοποίηση εκτεταμένων πληροφοριών για την ώρα: %x + +[1 Thread] +[%x Threads] + + Invalid FreeFileSync config file! Το αρχείο διάταξης του FreeFileSync δεν είναι έγκυρο! File does not exist: @@ -229,20 +240,18 @@ The command line is executed each time: Ενεργή παρακολούθηση... Waiting for missing directories... Αναμονή για τους υποκαταλόγους που απουσιάζουν... -Could not initialize directory monitoring: -Δεν ήταν δυνατό να γίνει έναρξη παρακολούθησης του υποκαταλόγου: A directory input field is empty. Ένα πεδίο εισόδου είναι κενό. -Error when monitoring directories. -Σφάλμα κατά την παρακολούθηση υποκαταλόγων. Drag && drop Μεταφορά && Απόθεση +Could not initialize directory monitoring: +Δεν ήταν δυνατό να γίνει έναρξη παρακολούθησης του υποκαταλόγου: +Error when monitoring directories. +Σφάλμα κατά την παρακολούθηση υποκαταλόγων. Conversion error: Σφάλμα μετατροπής: Error moving file: Σφάλμα κατά τη μεταφορά του αρχείου: -Operation aborted! -Η λειτουργία ματαιώθηκε! Target file already existing! Το αρχείο προορισμού υπάρχει ήδη! Error moving directory: @@ -273,6 +282,8 @@ The command line is executed each time: Σφάλμα κατά την εγγραφή του αρχείου: Error reading file: Σφάλμα κατά την ανάγνωση του αρχείου: +Operation aborted! +Η λειτουργία ματαιώθηκε! Endless loop when traversing directory: Ατέρμονος βρόχος κατά την την ανάλυση του υποκαταλόγου: Error traversing directory: @@ -413,24 +424,22 @@ The command line is executed each time: Για την αυτοματοποίηση του συγχρονισμού δημιουργείστε ένα αρχείο δέσμης ενεργειών. Για να ξεκινήσετε σε κατάσταση λειτουργίας της δέσμης, απλώς κάντε διπλό κλικ στο αρχείο ή γράψτε στη γραμμή εντολών: FreeFileSync.exe . Μπορείτε επίσης το προγραμματίσετε αυτήν την εργασία, χρησιμοποιώντας το χρονοδιάγραμμα εργασιών του λειτουργικού σας συστήματος. Help Βοήθεια -Configuration overview: -Σύνοψη της διάταξης: Filter files Φιλτράρισμα -Status feedback -Αναφορά κατάστασης -Silent mode -Σιωπηλή λειτουργία -Start minimized and write status information to a logfile -Έναρξη σε ελαχιστοποίηση και εγγραφή πληροφοριών κατάστασης σε αρχείο καταγραφής. Error handling Διαχείριση σφαλμάτων Overview Σύνοψη -Select logfile directory: -Επιλέξτε έναν κατάλογο για το αρχείο καταγραφής: +Status feedback +Αναφορά κατάστασης +Run minimized + Maximum number of logfiles: Μέγιστος αριθμός αρχείων καταγραφής: +Select logfile directory: +Επιλέξτε έναν κατάλογο για το αρχείο καταγραφής: +Batch settings + &Save &Αποθήκευση &Load @@ -695,10 +704,6 @@ Transfer file and directory permissions Ζεύγη υποκαταλόγων Select view Επιλογή εμφάνισης -Folder Comparison and Synchronization -Σύγκριση υποκαταλόγων και Συγχρονισμός -Recycle Bin not yet supported for this system! -Ο Κάδος Ανακύκλωσης δεν υποστηρίζεται σε αυτό το σύστημα! Set direction: Επιλογή κατεύθυνσης: Exclude temporarily @@ -733,6 +738,8 @@ Transfer file and directory permissions Να αποθηκευτούν οι αλλαγές στην τρέχουσα διάταξη; Configuration loaded! Η διάταξη έχει ανοιχθεί! +Folder Comparison and Synchronization +Σύγκριση υποκαταλόγων και Συγχρονισμός Hide files that exist on left side only Απόκρυψη των αρχείων που υπάρχουν μόνο στα αριστερά Show files that exist on left side only @@ -941,10 +948,6 @@ Transfer file and directory permissions Ρύθμιση προεπιλεγμένης κατεύθυνσης συγχρονισμού: Τα νεότερα αρχεία θα αντικαταστήσουν τα παλιότερα. The file does not contain a valid configuration: Το αρχείο δεν περιέχει μια έγκυρη διάταξη: -Scanning: -Ανίχνευση: -Encoding extended time information: %x -Κωδικοποίηση εκτεταμένων πληροφοριών για την ώρα: %x You can ignore this error to consider the directory as empty. Μπορείτε να αγνοήσετε αυτό το σφάλμα και να θεωρήσετε τον υποκατάλογο κενό. Directory does not exist: @@ -1021,8 +1024,6 @@ Transfer file and directory permissions Ενημέρωση των χαρακτηριστικών αρχείου του %x Source directory does not exist anymore: Ο υποκατάλογος προέλευσης δεν υπάρχει πλέον: -Generating database... -Δημιουργία βάσης δεδομένων... Nothing to synchronize according to configuration! Τίποτα προς συγχρονισμό με βάση τη διάταξη! Target directory name must not be empty! @@ -1043,10 +1044,14 @@ Transfer file and directory permissions Απαιτούμενος ελεύθερος χώρος δίσκου: Free disk space available: Διαθέσιμος ελεύθερος χώρος δίσκου: +Recycle Bin is not available for the following paths! Files will be deleted permanently instead: + A directory will be modified which is part of multiple folder pairs! Please review synchronization settings! Θα τροποποιηθεί ένας υποκατάλογος που ανήκει σε πολλαπλά ζεύγη υποκαταλόγων! Παρακαλώ αναθεωρείστε τις ρυθμίσεις συγχρονισμού. Processing folder pair: Σύγκριση του ζεύγους υποκαταλόγων: +Generating database... +Δημιουργία βάσης δεδομένων... Error copying locked file %x! Σφάλμα κατά την αντιγραφή του κλειδωμένου αρχείου %x ! Data verification error: Source and target file have different content! diff --git a/BUILD/Languages/hebrew.lng b/BUILD/Languages/hebrew.lng index 22de79f5..7e26c0fb 100644 --- a/BUILD/Languages/hebrew.lng +++ b/BUILD/Languages/hebrew.lng @@ -7,6 +7,8 @@ n == 1 ? 0 : 1 +Searching for directory %x... + Show in Explorer הראה בסייר הקבצים Open with default application @@ -17,8 +19,8 @@ RealtimeSync - סינכרון אוטומטי Browse עיין -Invalid commandline: "%x" -שורת פקודות שגויה: "%x" +Invalid commandline: %x +שורת פקודות שגויה: %x Error resolving symbolic link: שגיאה בפענוח קישור סימבולי (Symbolic Link) Show popup @@ -109,10 +111,10 @@ סנכרון ראשוני: One of the FreeFileSync database files is not yet existing: אחד מקובצי בסיס הנתונים הבא עדיין לא קיים -One of the FreeFileSync database entries within the following file is not yet existing: -אחת מהכניסות בבסיס הנתונים בקובץ הבא עדיין לא קיימת Error reading from synchronization database: שגיאה בקריאה מבסיס הנתונים של הסנכרון: +Database files do not share a common synchronization session: + An exception occurred! אירוע חריג! Error deleting file: @@ -135,6 +137,15 @@ מידע Fatal Error שגיאה פטלית +Scanning: +סורק: +Encoding extended time information: %x +מקודד אינפורמצית זמן מורחבת: %x + +[1 Thread] +[%x Threads] + + Invalid FreeFileSync config file! קובץ תצורה בלתי חוקי! File does not exist: @@ -229,20 +240,18 @@ The command line is executed each time: נטר ארכיב... Waiting for missing directories... מחכה למחיצות חסרות... -Could not initialize directory monitoring: -לא יכול לאתחל ניטור מחיצה: A directory input field is empty. שדה כניסת מחיצה ריק. -Error when monitoring directories. -שגיאה בזמן ניטור מחיצות. Drag && drop גרור והשלך +Could not initialize directory monitoring: +לא יכול לאתחל ניטור מחיצה: +Error when monitoring directories. +שגיאה בזמן ניטור מחיצות. Conversion error: שגיאה בהסבה: Error moving file: שגיאה בהעברת קובץ: -Operation aborted! -הפעולה בוטלה! Target file already existing! קובץ מטרה כבר קיים! Error moving directory: @@ -273,6 +282,8 @@ The command line is executed each time: שגיאה בכתיבת קובץ: Error reading file: שגיאה בקריאת קובץ: +Operation aborted! +הפעולה בוטלה! Endless loop when traversing directory: נוצרת לולאה אינסופית בחצית מחיצות Error traversing directory: @@ -413,24 +424,22 @@ The command line is executed each time: יצור קובץ אצווה לסנכרון אוטומטי. להפעלה באצווה העבר את שם הקובץ כפרמטר לתוכנה FreeFileSync.exe . אפשר גם להשתמש במנהל המשימות המתוזמנות של המערכת. Help עזרה -Configuration overview: -סקירת תצורה: Filter files קבצי המסנן -Status feedback -משוב מצב -Silent mode -אופן פעולה שקט -Start minimized and write status information to a logfile -הפעל במצב ממוזער ורשום מצב לקובץ יומן Error handling טיפול בשגיאות Overview מבט כללי -Select logfile directory: -בחר מחיצה לקבצי יומן +Status feedback +משוב מצב +Run minimized + Maximum number of logfiles: מספר מכסימלי של קבצי יומן +Select logfile directory: +בחר מחיצה לקבצי יומן +Batch settings + &Save &שמירה &Load @@ -695,10 +704,6 @@ Transfer file and directory permissions זוגות מחיצות Select view בחר תצוגה -Folder Comparison and Synchronization -סנכרון קבצים ומחיצות -Recycle Bin not yet supported for this system! -סל המחזור לא נתמך כרגע במערכת הפעלה זו! Set direction: בחר כוון: Exclude temporarily @@ -733,6 +738,8 @@ Transfer file and directory permissions שמור שינויים לתצורה נוכחית? Configuration loaded! תצורה הוטענה! +Folder Comparison and Synchronization +סנכרון קבצים ומחיצות Hide files that exist on left side only הסתר קבצים הקימים אך ורק בצד שמאל Show files that exist on left side only @@ -941,10 +948,6 @@ Transfer file and directory permissions בחר ברירת מחדל של סנכרון: קבצים ישנים ידרסו ע"י קבצים חדשים יותר. The file does not contain a valid configuration: קובץ זה לא מכיל קונפיגורציה ברת תוקף -Scanning: -סורק: -Encoding extended time information: %x -מקודד אינפורמצית זמן מורחבת: %x You can ignore this error to consider the directory as empty. אפשר להתעלם משגיאה זו ולהניח כי המחיצה ריקה. Directory does not exist: @@ -1021,8 +1024,6 @@ Transfer file and directory permissions מעדכן תכונות של %x Source directory does not exist anymore: מחיצת המקור לא נמצאת: -Generating database... -מיצר בסיס נתונים... Nothing to synchronize according to configuration! אין מה לסנכרן ע"פ הקונפיגורציה! Target directory name must not be empty! @@ -1043,10 +1044,14 @@ Transfer file and directory permissions מקום דיסק פנוי נדרש: Free disk space available: מקום פנוי בדיסק: +Recycle Bin is not available for the following paths! Files will be deleted permanently instead: + A directory will be modified which is part of multiple folder pairs! Please review synchronization settings! מחיצה שתשתנה היא חלק מריבוי זוגות מחיצות! בבקשה בדוק הגדרות סינכרון! Processing folder pair: מבצע זוג מחיצות: +Generating database... +מיצר בסיס נתונים... Error copying locked file %x! שגיאה בהעתקת קובץ נעול %x! Data verification error: Source and target file have different content! diff --git a/BUILD/Languages/hungarian.lng b/BUILD/Languages/hungarian.lng index 2ab1e43f..06e05ba4 100644 --- a/BUILD/Languages/hungarian.lng +++ b/BUILD/Languages/hungarian.lng @@ -7,6 +7,8 @@ n == 1 ? 0 : 1 +Searching for directory %x... + Show in Explorer Mutatás az Intézőben Open with default application @@ -17,8 +19,8 @@ RealtimeSync - Automatikus szinkronizálás Browse Tallózás -Invalid commandline: "%x" -Érvénytelen parancssor: "%x" +Invalid commandline: %x +Érvénytelen parancssor: %x Error resolving symbolic link: A szimbolikus link feloldása sikertelen: Show popup @@ -109,10 +111,10 @@ Első szinkronizáció: One of the FreeFileSync database files is not yet existing: A FreeFileSync egyik adatbázisfájlja nem létezik: -One of the FreeFileSync database entries within the following file is not yet existing: -A FreeFileSync a következő fájlban lévő egyik adatbázisbejegyzése nem található: Error reading from synchronization database: Hiba történt a szinkronizációs adatbázis olvasása közben: +Database files do not share a common synchronization session: + An exception occurred! Kivétel keletkezett! Error deleting file: @@ -135,6 +137,15 @@ Információ Fatal Error Kritikus hiba +Scanning: +Vizsgálat: +Encoding extended time information: %x +Kibővített időinformációk kódolása: %x + +[1 Thread] +[%x Threads] + + Invalid FreeFileSync config file! Érvénytelen a FreeFileSync beállításait tartalmazó fájl! File does not exist: @@ -229,20 +240,18 @@ A parancssor végrehajtódik minden alkalommal, ha: Figyelés aktív... Waiting for missing directories... Várakozás a hiányzó mappákra... -Could not initialize directory monitoring: -A mappafigyelés inicializálása sikertelen: A directory input field is empty. Valamelyik mappa megadására szolgáló mező üres. -Error when monitoring directories. -Hiba történt a mappák figyelése közben. Drag && drop Húzd && Ejtsd +Could not initialize directory monitoring: +A mappafigyelés inicializálása sikertelen: +Error when monitoring directories. +Hiba történt a mappák figyelése közben. Conversion error: Konverziós hiba: Error moving file: Hiba a fájl mozgatásakor: -Operation aborted! -Művelet megszakítva! Target file already existing! A célként megadott fájl már létezik! Error moving directory: @@ -273,6 +282,8 @@ A parancssor végrehajtódik minden alkalommal, ha: A fájl írása sikertelen: Error reading file: A fájl olvasása sikertelen: +Operation aborted! +Művelet megszakítva! Endless loop when traversing directory: Végtelen hurok a mappák bejárásakor: Error traversing directory: @@ -413,24 +424,22 @@ A parancssor végrehajtódik minden alkalommal, ha: Kötegelt feladat fájl létrehozása az automatizált szinkronizációhoz. Kötegelt feladat módban való indításhoz csak simán duplát kell kattintani a fájlon vagy a parancssorból kell futtatni: FreeFileSync.exe .futtasd egyszerűen meg kell adni a fájl nevét a FreeFileSync.exe-nek: FreeFileSync.exe . Ezt ütemezni is lehet az operációs rendszer feladatkezelőjével. Help Súgó -Configuration overview: -Beállítások áttekintése: Filter files Fájlok szűrése -Status feedback -Státusz visszajelzés -Silent mode -Csendes mód -Start minimized and write status information to a logfile -Indítás lekicsinyítve és a státuszinformációk mentése naplófájlba Error handling Hibakezelés Overview Összefoglaló -Select logfile directory: -Naplófájl mappájának kiválasztása: +Status feedback +Státusz visszajelzés +Run minimized + Maximum number of logfiles: Naplófájlok maximális száma: +Select logfile directory: +Naplófájl mappájának kiválasztása: +Batch settings + &Save &Mentés &Load @@ -698,10 +707,6 @@ Fájlok és mappák jogosultságainak átvitele Mappa párok Select view Nézet kiválasztása -Folder Comparison and Synchronization -Mappa összehasonlítás és szinkronizáció -Recycle Bin not yet supported for this system! -A Lomtár (Recycle Bin) nem támogatott ezen a rendszeren! Set direction: Irány Exclude temporarily @@ -736,6 +741,8 @@ Fájlok és mappák jogosultságainak átvitele Mentsük a beállítások változásait? Configuration loaded! Beállítások betöltve! +Folder Comparison and Synchronization +Mappa összehasonlítás és szinkronizáció Hide files that exist on left side only Csak a bal oldalon létező fájlok elrejtése Show files that exist on left side only @@ -944,10 +951,6 @@ Fájlok és mappák jogosultságainak átvitele Alapértelmezett szinkronizációs irányok beállítása: a régebbi fájlok felülíródnak az újabbakkal. The file does not contain a valid configuration: A következő fájl nem tartalmaz érvényes beállításokat: -Scanning: -Vizsgálat: -Encoding extended time information: %x -Kibővített időinformációk kódolása: %x You can ignore this error to consider the directory as empty. Figyelmen kívül hagyhatod ezt a hibát, üresnek tekintve a mappát. Directory does not exist: @@ -1024,8 +1027,6 @@ Fájlok és mappák jogosultságainak átvitele A(z) %x attribútumainak frissítése Source directory does not exist anymore: A forrásként megadott mappa többé nem létezik: -Generating database... -Adatbázis generálása... Nothing to synchronize according to configuration! A beállításoknak megfelelően nincs mit szinkronizálni! Target directory name must not be empty! @@ -1046,10 +1047,14 @@ Fájlok és mappák jogosultságainak átvitele Szükséges szabad lemezterület: Free disk space available: Szabad lemezterület: +Recycle Bin is not available for the following paths! Files will be deleted permanently instead: + A directory will be modified which is part of multiple folder pairs! Please review synchronization settings! Egy olyan mappa kerül módosításra, amely tagja több mappa párosnak! Kérjük, nézd át a szinkronizációs beállításokat! Processing folder pair: Mappapár feldolgozása: +Generating database... +Adatbázis generálása... Error copying locked file %x! Hiba történt a(z) %x zárolt fájl másolása közben! Data verification error: Source and target file have different content! diff --git a/BUILD/Languages/italian.lng b/BUILD/Languages/italian.lng index 32324996..77c8d6b4 100644 --- a/BUILD/Languages/italian.lng +++ b/BUILD/Languages/italian.lng @@ -7,6 +7,8 @@ n == 1 ? 0 : 1 +Searching for directory %x... + Show in Explorer Mostra in Esplora Risorse Open with default application @@ -17,8 +19,8 @@ RealtimeSync - Sincronizzazione Automatizzata Browse Sfoglia -Invalid commandline: "%x" -Comando non valido: "%x" +Invalid commandline: %x +Comando non valido: %x Error resolving symbolic link: Errore nella risoluzione di collegamento simbolico: Show popup @@ -109,10 +111,10 @@ Prima sincronizzazione: One of the FreeFileSync database files is not yet existing: Un file database di FreeFileSync non è ancora stato creato: -One of the FreeFileSync database entries within the following file is not yet existing: -Una voce del database di FreeFileSync nel seguente file non e' ancora stata creata: Error reading from synchronization database: Errore in lettura dal database di sincronizzione: +Database files do not share a common synchronization session: + An exception occurred! Si è verificato un problema! Error deleting file: @@ -135,6 +137,15 @@ Info Fatal Error Errore Fatale +Scanning: +Analisi in corso: +Encoding extended time information: %x +Codifica estesa informazioni orario: %x + +[1 Thread] +[%x Threads] + + Invalid FreeFileSync config file! File di configurazione FreeFileSync non valido! File does not exist: @@ -229,20 +240,18 @@ La linea di comando è eseguita ogni volta che: Monitoraggio attivo... Waiting for missing directories... In attesa delle directory mancanti... -Could not initialize directory monitoring: -Monitoraggio directory non inizializzabile: A directory input field is empty. Un campo directory di input è vuoto. -Error when monitoring directories. -Errore durante il monitoraggio directory. Drag && drop Drag && drop +Could not initialize directory monitoring: +Monitoraggio directory non inizializzabile: +Error when monitoring directories. +Errore durante il monitoraggio directory. Conversion error: Errore di conversione: Error moving file: Errore nello spostamento file: -Operation aborted! -Operazione abortita! Target file already existing! File destinazione già esistente! Error moving directory: @@ -273,6 +282,8 @@ La linea di comando è eseguita ogni volta che: Errore durante la scrittura del file: Error reading file: Errore durante la lettura del file: +Operation aborted! +Operazione abortita! Endless loop when traversing directory: Loop senza fine attraverso le directory: Error traversing directory: @@ -413,24 +424,22 @@ La linea di comando è eseguita ogni volta che: Crea un file batch per sincronizzazione automatica. Per partire in modalità batch effettua semplicemente doppio click sul file o esegui da linea di comando: FreeFileSync.exe . Puoi anche schedulare il batch nelle operazioni pianificate del tuo sistema operativo. Help Aiuto -Configuration overview: -Controllo configurazione: Filter files Filtro dei files -Status feedback -Feedback di stato -Silent mode -Modalità Silenziosa -Start minimized and write status information to a logfile -Lancia minimizzato e scrivi informazioni di stato in un file log Error handling Gestione degli errori Overview Controllo generale -Select logfile directory: -Seleziona cartella per il file di log: +Status feedback +Feedback di stato +Run minimized + Maximum number of logfiles: Numero massimo di logfiles: +Select logfile directory: +Seleziona cartella per il file di log: +Batch settings + &Save &Salva &Load @@ -694,10 +703,6 @@ Trasferisci file e permessi sulle cartelle Coppia di cartelle Select view Seleziona vista -Folder Comparison and Synchronization -Comparazione di Cartelle e Sincronizzazione -Recycle Bin not yet supported for this system! -Cestino non ancora supportato per questo sistema! Set direction: Imposta direzione: Exclude temporarily @@ -732,6 +737,8 @@ Trasferisci file e permessi sulle cartelle Salvare i cambiamenti alla configurazione corrente? Configuration loaded! Configurazione caricata! +Folder Comparison and Synchronization +Comparazione di Cartelle e Sincronizzazione Hide files that exist on left side only Nascondi i file esistenti solo a sinistra Show files that exist on left side only @@ -940,10 +947,6 @@ Trasferisci file e permessi sulle cartelle Imposta direzioni di sincronizzazione di default: I vecchi file saranno sovrascritti dai nuovi. The file does not contain a valid configuration: Il file non contiene una configurazione valida -Scanning: -Analisi in corso: -Encoding extended time information: %x -Codifica estesa informazioni orario: %x You can ignore this error to consider the directory as empty. Puoi ignorare questo errore per considerare la directory come vuota. Directory does not exist: @@ -1020,8 +1023,6 @@ Trasferisci file e permessi sulle cartelle Aggiornamento attributi di %x Source directory does not exist anymore: La directory sorgente non è più esistente: -Generating database... -Generazione database... Nothing to synchronize according to configuration! Niente da sincronizzare in questa configurazione! Target directory name must not be empty! @@ -1042,10 +1043,14 @@ Trasferisci file e permessi sulle cartelle Spazio libero su disco richiesto: Free disk space available: Spazio libero su disco disponibile: +Recycle Bin is not available for the following paths! Files will be deleted permanently instead: + A directory will be modified which is part of multiple folder pairs! Please review synchronization settings! Una directory che fa parte di più coppie di cartelle sarà modificata! Ricontrolla le impostazioni di sincronizzazione! Processing folder pair: Elaborazione coppia di cartelle: +Generating database... +Generazione database... Error copying locked file %x! Errore durante la copia del file bloccato %x! Data verification error: Source and target file have different content! diff --git a/BUILD/Languages/japanese.lng b/BUILD/Languages/japanese.lng index a5fd933c..2530420e 100644 --- a/BUILD/Languages/japanese.lng +++ b/BUILD/Languages/japanese.lng @@ -7,6 +7,8 @@ 0 +Searching for directory %x... + Show in Explorer エクスプローラで表示 Open with default application @@ -17,8 +19,8 @@ リアルタイム同期 - 自動同期 Browse 参照 -Invalid commandline: "%x" -無効なコマンドライン: "%x" +Invalid commandline: %x +無効なコマンドライン: %x Error resolving symbolic link: シンボリックリンクの解決に失敗: Show popup @@ -108,10 +110,10 @@ 同期処理の初期化: One of the FreeFileSync database files is not yet existing: FreeFileSync データベースファイルが存在しません: -One of the FreeFileSync database entries within the following file is not yet existing: -FreeFileSync データベースに、以下のファイルに関するエントリは存在しません: Error reading from synchronization database: 同期データベースからの読み込みエラー: +Database files do not share a common synchronization session: + An exception occurred! 例外が発生しました! Error deleting file: @@ -133,6 +135,15 @@ 情報 Fatal Error 致命的なエラー +Scanning: +スキャン: +Encoding extended time information: %x +拡張された時間情報のエンコーディング: %x + +[1 Thread] +[%x Threads] + + Invalid FreeFileSync config file! 無効な FreeFileSync 構成ファイルです! File does not exist: @@ -224,20 +235,18 @@ The command line is executed each time: 監視を開始します... Waiting for missing directories... 見失ったディレクトリの待機中 -Could not initialize directory monitoring: -監視するディレクトリを初期化できません: A directory input field is empty. ディレクトリが入力されていません -Error when monitoring directories. -ディレクトリの監視エラー Drag && drop ドラッグ && ドロップ +Could not initialize directory monitoring: +監視するディレクトリを初期化できません: +Error when monitoring directories. +ディレクトリの監視エラー Conversion error: 変換エラー: Error moving file: ファイルの移動に失敗: -Operation aborted! -操作の中断! Target file already existing! 対象ファイルは既に存在します! Error moving directory: @@ -268,6 +277,8 @@ The command line is executed each time: ファイル書き込みエラー: Error reading file: ファイル読み込みエラー: +Operation aborted! +操作の中断! Endless loop when traversing directory: ディレクトリ移動中に無限ループが発生: Error traversing directory: @@ -408,24 +419,22 @@ The command line is executed each time: 同期を一括で自動的に実行するためのバッチファイルを作成します。実行は.BAT ファイルをダブルクリック、または次のコマンドラインを実行します: FreeFileSync.exe.BAT ファイルは、OS のタスクスケジューラで実行することも可能です Help ヘルプ -Configuration overview: -構成設定の概要: Filter files ファイルフィルター -Status feedback -状態 フィードバック -Silent mode -サイレントモード -Start minimized and write status information to a logfile -最小化状態で起動して、ステータス情報をログファイルに書き出す Error handling ハンドリングのエラー時: Overview 概要 -Select logfile directory: -ログファイルの保存先を選択: +Status feedback +状態 フィードバック +Run minimized + Maximum number of logfiles: ログファイルの最大数: +Select logfile directory: +ログファイルの保存先を選択: +Batch settings + &Save 保存(&S) &Load @@ -690,10 +699,6 @@ Transfer file and directory permissions フォルダ・ペア Select view 表示選択 -Folder Comparison and Synchronization -フォルダの比較と同期 -Recycle Bin not yet supported for this system! -このシステムでは、ゴミ箱に対応していません! Set direction: 方向の設定: Exclude temporarily @@ -728,6 +733,8 @@ Transfer file and directory permissions 現在の構成の変更を保存しますか? Configuration loaded! 構成設定を読み込み中! +Folder Comparison and Synchronization +フォルダの比較と同期 Hide files that exist on left side only 左側のみに存在するファイルを非表示 Show files that exist on left side only @@ -930,10 +937,6 @@ Transfer file and directory permissions 同期方向のデフォルト設定: 古いファイルに新しいファイルを上書き The file does not contain a valid configuration: このファイルには有効な構成が含まれていません: -Scanning: -スキャン: -Encoding extended time information: %x -拡張された時間情報のエンコーディング: %x You can ignore this error to consider the directory as empty. ディレクトリが空と考慮する場合、このエラーは無視できます。 Directory does not exist: @@ -1010,8 +1013,6 @@ Transfer file and directory permissions %x の属性を更新 Source directory does not exist anymore: ソースディレクトリが存在しません: -Generating database... -データベースを作成中... Nothing to synchronize according to configuration! 構成設定に対応する同期がみつかりません! Target directory name must not be empty! @@ -1032,10 +1033,14 @@ Transfer file and directory permissions 必要なディスク空き容量: Free disk space available: 利用可能なディスク空き容量: +Recycle Bin is not available for the following paths! Files will be deleted permanently instead: + A directory will be modified which is part of multiple folder pairs! Please review synchronization settings! 複数ペアのディレクトリ設定部分に変更された箇所があります! 同期設定を再確認してみてください! Processing folder pair: フォルダペアを処理中: +Generating database... +データベースを作成中... Error copying locked file %x! コピーに失敗! ファイル%x はロックされています! Data verification error: Source and target file have different content! diff --git a/BUILD/Languages/korean.lng b/BUILD/Languages/korean.lng index a476f52c..50ccc158 100644 --- a/BUILD/Languages/korean.lng +++ b/BUILD/Languages/korean.lng @@ -7,6 +7,8 @@ 0 +Searching for directory %x... + Show in Explorer 탐색기에 표시 Open with default application @@ -17,8 +19,8 @@ 실시간 동기화 - 자동 동기화 Browse 찾아보기 -Invalid commandline: "%x" -잘못된 커맨드라인 +Invalid commandline: %x + Error resolving symbolic link: 심볼릭 링크를 해결하던 중 발생한 오류 : Show popup @@ -108,10 +110,10 @@ 초기 동기화 : One of the FreeFileSync database files is not yet existing: FreeFileSync 데이터베이스 파일 중 하나가 아직 존재하지 않습니다 : -One of the FreeFileSync database entries within the following file is not yet existing: -다음 파일 내에 있는 FreeFileSync 데이터베이스 엔트리 중 하나가 아직 존재하지 않습니다 : Error reading from synchronization database: 동기화 데이터베이스로부터 읽어 들이던 중 발생한 오류 : +Database files do not share a common synchronization session: + An exception occurred! 예외 발생! Error deleting file: @@ -133,6 +135,15 @@ 정보 Fatal Error 치명적 오류 +Scanning: +스캔 : +Encoding extended time information: %x +인코딩 확장 시간 정보 : %x + +[1 Thread] +[%x Threads] + + Invalid FreeFileSync config file! 잘못된 FreeFileSync 설정 파일! File does not exist: @@ -224,20 +235,18 @@ The command line is executed each time: 모니터링 활성화... Waiting for missing directories... 누락 디렉토리 대기 중... -Could not initialize directory monitoring: -디렉토리 모니터링을 초기화 할 수 없습니다 : A directory input field is empty. 디렉토리 입력 필드가 비어 있습니다. -Error when monitoring directories. -디렉토리 모니터링 중 발생한 오류 : Drag && drop 드래그 && 드랍 +Could not initialize directory monitoring: +디렉토리 모니터링을 초기화 할 수 없습니다 : +Error when monitoring directories. +디렉토리 모니터링 중 발생한 오류 : Conversion error: 변환 오류 : Error moving file: 파일 이동 중 발생한 오류 : -Operation aborted! -작업 중단! Target file already existing! 대상 파일이 이미 존재합니다! Error moving directory: @@ -268,6 +277,8 @@ The command line is executed each time: 파일을 쓰던 중 발생한 오류 : Error reading file: 파일을 읽던 중 발생한 오류 : +Operation aborted! +작업 중단! Endless loop when traversing directory: 디렉토리 이동 중 무한 루프 발생 : Error traversing directory: @@ -408,24 +419,22 @@ The command line is executed each time: 자동 동기화를 위한 일괄파일 생성. 일괄모드 작업은 해당 파일을 더블클릭 하거나 커맨드라인: FreeFileSync.exe <일괄파일>을 통해 실행 가능합니다. 또한 운영체제(O/S)의 작업관리자에서도 예약할 수 있습니다. Help 도움말 -Configuration overview: -구성설정 개요 : Filter files 파일 필터 -Status feedback -상태 피드백 -Silent mode -사일런트 모드 -Start minimized and write status information to a logfile -최소화 상태로 시작하고, 로그파일에 상태 정보를 기록 Error handling 오류 발생시 : Overview 개요 -Select logfile directory: -로그파일 디렉토리 선택 : +Status feedback +상태 피드백 +Run minimized + Maximum number of logfiles: 최대 로그파일 개수 : +Select logfile directory: +로그파일 디렉토리 선택 : +Batch settings + &Save 저장(&S) &Load @@ -688,10 +697,6 @@ Transfer file and directory permissions 폴더 페어(짝) Select view 보기 선택 -Folder Comparison and Synchronization -폴더 비교 및 동기화 -Recycle Bin not yet supported for this system! -본 시스템에서는 휴지통을 아직 지원하지 않습니다. Set direction: 방향 설정 : Exclude temporarily @@ -726,6 +731,8 @@ Transfer file and directory permissions 현재 설정의 변경 내용을 저장하시겠습니까? Configuration loaded! 설정 로드 완료! +Folder Comparison and Synchronization +폴더 비교 및 동기화 Hide files that exist on left side only 좌측에만 존재하는 파일 숨기기 Show files that exist on left side only @@ -928,10 +935,6 @@ Transfer file and directory permissions 기본값 동기화 방향 설정 : 이전 파일들은 신규 파일들로 덮어 쓰여집니다. The file does not contain a valid configuration: 이 파일은 유효한 설정 값을 갖고 있지 않습니다 : -Scanning: -스캔 : -Encoding extended time information: %x -인코딩 확장 시간 정보 : %x You can ignore this error to consider the directory as empty. 디렉토리가 비었다는 오류는 무시 가능합니다. Directory does not exist: @@ -1008,8 +1011,6 @@ Transfer file and directory permissions %x 속성 업데이트 Source directory does not exist anymore: 소스 디렉토리가 더 이상 존재하지 않습니다 : -Generating database... -데이터베이스 생성 중... Nothing to synchronize according to configuration! 구성 설정에 따라 동기화 할 내용이 없습니다! Target directory name must not be empty! @@ -1030,10 +1031,14 @@ Transfer file and directory permissions 필요한 디스크 여유 공간 : Free disk space available: 사용 가능한 디스크 여유 공간 : +Recycle Bin is not available for the following paths! Files will be deleted permanently instead: + A directory will be modified which is part of multiple folder pairs! Please review synchronization settings! 다중폴더 페어의 일부인 디렉토리가 변경됩니다. 동기화 설정을 재검토해 주세요. Processing folder pair: 폴더 페어 처리 중 : +Generating database... +데이터베이스 생성 중... Error copying locked file %x! 복사 실패! 파일 %x 에 락이 걸려 있습니다. Data verification error: Source and target file have different content! diff --git a/BUILD/Languages/polish.lng b/BUILD/Languages/polish.lng index a4fec878..d815e09c 100644 --- a/BUILD/Languages/polish.lng +++ b/BUILD/Languages/polish.lng @@ -7,6 +7,8 @@ n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2 +Searching for directory %x... + Show in Explorer Wyświetl w explorerze Open with default application @@ -17,8 +19,8 @@ RealtimeSync - Automatyczna Synchronizacja Browse Przeglądaj -Invalid commandline: "%x" -Nieprawidłowa komenda: "%x" +Invalid commandline: %x +Nieprawidłowa komenda: %x Error resolving symbolic link: Błąd odczytu dowiązania symbolicznego: Show popup @@ -110,10 +112,10 @@ Wstępna synchronizacja: One of the FreeFileSync database files is not yet existing: Jeden z plików bazy danych FreeFileSync nie istnieje: -One of the FreeFileSync database entries within the following file is not yet existing: -Jeden z wpisów bazy danych FreeFileSync dotyczący pliku nie istnieje: Error reading from synchronization database: Błąd odczytu z bazy danych synchronizacji: +Database files do not share a common synchronization session: + An exception occurred! Wystąpił wyjątek! Error deleting file: @@ -137,6 +139,15 @@ Info Fatal Error Błąd krytyczny +Scanning: +Skanowanie: +Encoding extended time information: %x +Odkodowywanie rozszerzonych informacji o czasie: %x + +[1 Thread] +[%x Threads] + + Invalid FreeFileSync config file! Nieprawidłowy plik konfiguracyjny! File does not exist: @@ -234,20 +245,18 @@ Komenda jest wykonwywana za każdym razem gdy: Monitorowanie aktywne... Waiting for missing directories... Oczekiwanie na brakujące katalogi... -Could not initialize directory monitoring: -Nie można uruchomić monitora katalogów: A directory input field is empty. Pole ze ścieżką katalogu jest puste. -Error when monitoring directories. -Błąd podczas monitorowania katalogów. Drag && drop Drag && Drop +Could not initialize directory monitoring: +Nie można uruchomić monitora katalogów: +Error when monitoring directories. +Błąd podczas monitorowania katalogów. Conversion error: Błąd konwersji: Error moving file: Błąd podczas przenoszenia pliku: -Operation aborted! -Operacja przerwana! Target file already existing! Plik docelowy już istnieje! Error moving directory: @@ -278,6 +287,8 @@ Komenda jest wykonwywana za każdym razem gdy: Błąd zapisu pliku: Error reading file: Błąd odczytu pliku: +Operation aborted! +Operacja przerwana! Endless loop when traversing directory: Zapętlenie podczas przeglądania katalogu: Error traversing directory: @@ -418,24 +429,22 @@ Komenda jest wykonwywana za każdym razem gdy: Utwórz plik wsadowy dla automatycznej synchronizacji. Aby uruchomić synchronizację w trybie wsadowym po prostu kliknij dwa razy na plik lub uruchom go z konsoli: FreeFileSync.exe . Możesz to dodać do programu planującego zadania w Twoim systemie. Help Pomoc -Configuration overview: -Przegląd konfiguracji: Filter files Filtruj pliki -Status feedback -Opinia statusu -Silent mode -Tryb Cichy -Start minimized and write status information to a logfile -Uruchom zminimalizowane i zapisuj informacje do pliku logów Error handling Obsługa błędów Overview Przegląd -Select logfile directory: -Wybierz katalog z logami: +Status feedback +Opinia statusu +Run minimized + Maximum number of logfiles: Maksymalna liczba plików z logami: +Select logfile directory: +Wybierz katalog z logami: +Batch settings + &Save &Zapisz &Load @@ -700,10 +709,6 @@ Transfer uprawnień plików i katalogów Pary folderów Select view Określ widok -Folder Comparison and Synchronization -Porównywanie i Synchronizacja folderów -Recycle Bin not yet supported for this system! -Kosz nie jest jeszcze wspierany dla tej wersji systemu! Set direction: Kierunek synchronizacji: Exclude temporarily @@ -738,6 +743,8 @@ Transfer uprawnień plików i katalogów Zapisać zmiany obecnej konfiguracji? Configuration loaded! Konfiguracja wczytana! +Folder Comparison and Synchronization +Porównywanie i Synchronizacja folderów Hide files that exist on left side only Ukryj pliki, które istnieją tylko po lewej stronie Show files that exist on left side only @@ -952,10 +959,6 @@ Transfer uprawnień plików i katalogów Ustawianie domyślnego kierunku synchronizacji: Stare pliki zostaną nadpisane nowszymi. The file does not contain a valid configuration: Nieprawidłowy format pliku: -Scanning: -Skanowanie: -Encoding extended time information: %x -Odkodowywanie rozszerzonych informacji o czasie: %x You can ignore this error to consider the directory as empty. Możesz zignorować ten błąd uznająć jeden z katalogów jako pusty. Directory does not exist: @@ -1032,8 +1035,6 @@ Transfer uprawnień plików i katalogów Aktualizowanie atrybutów %x Source directory does not exist anymore: Katalog źródłowy nie istnieje: -Generating database... -Generowanie bazy danych... Nothing to synchronize according to configuration! Brak elementów do synchronizacji! Target directory name must not be empty! @@ -1054,10 +1055,14 @@ Transfer uprawnień plików i katalogów Wymagane wolne miejsce: Free disk space available: Wolne miejsce: +Recycle Bin is not available for the following paths! Files will be deleted permanently instead: + A directory will be modified which is part of multiple folder pairs! Please review synchronization settings! Katalog zostanie zmodyfikowany w efekcie synchronizacji wielu par folderów! Zweryfikuj ustawienia synchronizacji! Processing folder pair: Przetwarzanie folderów: +Generating database... +Generowanie bazy danych... Error copying locked file %x! Błąd podczas kopiowania zablokowanego pliku %x! Data verification error: Source and target file have different content! diff --git a/BUILD/Languages/portuguese.lng b/BUILD/Languages/portuguese.lng index d64f02f5..88d2b092 100644 --- a/BUILD/Languages/portuguese.lng +++ b/BUILD/Languages/portuguese.lng @@ -7,6 +7,8 @@ n == 1 ? 0 : 1 +Searching for directory %x... + Show in Explorer Mostrar no Explorer Open with default application @@ -17,8 +19,8 @@ RealtimeSync - Sincronização Automática Browse Procurar -Invalid commandline: "%x" -Comando inválido: "%x" +Invalid commandline: %x +Comando inválido: %x Error resolving symbolic link: Erro na resolução do link simbólico: Show popup @@ -109,10 +111,10 @@ Sincronização inicial: One of the FreeFileSync database files is not yet existing: Um dos ficheiros da base de dados não existe: -One of the FreeFileSync database entries within the following file is not yet existing: -Uma das entradas da base de dados dentro do seguinte ficheiro não existe: Error reading from synchronization database: Erro ao ler a base de dados de sincronização: +Database files do not share a common synchronization session: + An exception occurred! Ocorreu uma excepção! Error deleting file: @@ -135,6 +137,15 @@ Info Fatal Error Erro fatal +Scanning: +A pesquisar: +Encoding extended time information: %x +A codificar dados temporais extendidos: %x + +[1 Thread] +[%x Threads] + + Invalid FreeFileSync config file! Ficheiro de configuração do FreeFileSync inválido! File does not exist: @@ -229,20 +240,18 @@ A linha de comandos é executada cada vez que: Monitorizar activado... Waiting for missing directories... Aguardar pelos directórios em falta... -Could not initialize directory monitoring: -Não é possível iniciar monitorização do directório: A directory input field is empty. Um campo de directório está vazio. -Error when monitoring directories. -Erro ao monitorizar os directórios. Drag && drop Arrastar && Largar +Could not initialize directory monitoring: +Não é possível iniciar monitorização do directório: +Error when monitoring directories. +Erro ao monitorizar os directórios. Conversion error: Erro de conversão: Error moving file: Erro ao mover o ficheiro: -Operation aborted! -Operação abortada! Target file already existing! Ficheiro de destino já existe! Error moving directory: @@ -273,6 +282,8 @@ A linha de comandos é executada cada vez que: Erro de escrita no ficheiro: Error reading file: Erro de leitura de ficheiro: +Operation aborted! +Operação abortada! Endless loop when traversing directory: Loop infinito ao percorrer directório: Error traversing directory: @@ -413,24 +424,22 @@ A linha de comandos é executada cada vez que: Criar um batch para sincronização automática. Para iniciar o batch, basta fazer duplo-clique no ficheiro ou executar via linha de comandos: FreeFileSync.exe . Também pode ser inserido no programador de tarefas do sistema operativo. Help Ajuda -Configuration overview: -Parametros de configuração: Filter files Filtrar ficheiros -Status feedback -Retorno de estado -Silent mode -Modo silencioso -Start minimized and write status information to a logfile -Iniciar minimizado e escrever info de estado para o log Error handling Controlador de erros Overview Vista -Select logfile directory: -Seleccione directório para ficheiro log: +Status feedback +Retorno de estado +Run minimized + Maximum number of logfiles: Número máximo de ficheiros log: +Select logfile directory: +Seleccione directório para ficheiro log: +Batch settings + &Save &Guardar &Load @@ -693,10 +702,6 @@ Transferir ficheiro e permissões Par de directório Select view Seleccionar vista -Folder Comparison and Synchronization -Comparação e Sincronização de pastas -Recycle Bin not yet supported for this system! -Reciclagem não é suportada para este sistema! Set direction: Escolher direcção: Exclude temporarily @@ -731,6 +736,8 @@ Transferir ficheiro e permissões Guardar alterações à configuração? Configuration loaded! Configuração carregada! +Folder Comparison and Synchronization +Comparação e Sincronização de pastas Hide files that exist on left side only Ocultar ficheiros existentes somente à esquerda Show files that exist on left side only @@ -939,10 +946,6 @@ Transferir ficheiro e permissões Escolher direcção de sincronização por defeito: Os ficheiros antigos serão substituídos pelos novos. The file does not contain a valid configuration: O ficheiro não contém uma configuração válida: -Scanning: -A pesquisar: -Encoding extended time information: %x -A codificar dados temporais extendidos: %x You can ignore this error to consider the directory as empty. Pode ignorar este erro para considerar o directório como vazio. Directory does not exist: @@ -1019,8 +1022,6 @@ Transferir ficheiro e permissões Actualizar atributos de %x Source directory does not exist anymore: A pasta de origem já não existe: -Generating database... -A gerar base de dados... Nothing to synchronize according to configuration! Nada a sincronizar de acordo com a configuração! Target directory name must not be empty! @@ -1041,10 +1042,14 @@ Transferir ficheiro e permissões Espaço livre necessário em disco: Free disk space available: Espaço livre em disco: +Recycle Bin is not available for the following paths! Files will be deleted permanently instead: + A directory will be modified which is part of multiple folder pairs! Please review synchronization settings! Um directório que pertencente a conjunto de vários directórios vai ser alterado! Por favor, verifique as opções de sincronização! Processing folder pair: A processar o par do directorio: +Generating database... +A gerar base de dados... Error copying locked file %x! Erro ao copiar ficheiro bloqueado %x! Data verification error: Source and target file have different content! diff --git a/BUILD/Languages/portuguese_br.lng b/BUILD/Languages/portuguese_br.lng index 57a63970..c0228212 100644 --- a/BUILD/Languages/portuguese_br.lng +++ b/BUILD/Languages/portuguese_br.lng @@ -7,6 +7,8 @@ n <= 1 ? 0 : 1 +Searching for directory %x... + Show in Explorer Mostrar no Explorer Open with default application @@ -17,8 +19,8 @@ RealtimeSync - Sincronização Automatizada Browse Procurar -Invalid commandline: "%x" -Comando de linha inválido: "%x" +Invalid commandline: %x +Comando de linha inválido: %x Error resolving symbolic link: Erro na resolução de link simbólico: Show popup @@ -109,10 +111,10 @@ Sincronização inicial: One of the FreeFileSync database files is not yet existing: Um dos arquivos de banco de dados do FreeFileSync ainda não existe: -One of the FreeFileSync database entries within the following file is not yet existing: -Um das entradas do banco de dados do FreeFileSync dentro do seguinte arquivo ainda não existe: Error reading from synchronization database: Erro ao ler do banco de dados de sincronização: +Database files do not share a common synchronization session: + An exception occurred! Ocorreu uma exceção! Error deleting file: @@ -135,6 +137,15 @@ Info Fatal Error Erro fatal +Scanning: +Pesquisando: +Encoding extended time information: %x +Codificando informações adicionais de tempo: %x + +[1 Thread] +[%x Threads] + + Invalid FreeFileSync config file! Arquivo de configuração do FreeFileSync inválido! File does not exist: @@ -229,20 +240,18 @@ A linha de comando é executada cada vez que: Monitoramento ativo... Waiting for missing directories... Esperando por diretórios faltantes... -Could not initialize directory monitoring: -Não foi possível inicializar o monitoramento de diretórios: A directory input field is empty. Um campo de entrada de diretório está vazio. -Error when monitoring directories. -Erro ao monitorar os diretórios. Drag && drop Arrastar && Soltar +Could not initialize directory monitoring: +Não foi possível inicializar o monitoramento de diretórios: +Error when monitoring directories. +Erro ao monitorar os diretórios. Conversion error: Erro de conversão: Error moving file: Erro ao mover arquivo: -Operation aborted! -Operação cancelada! Target file already existing! Arquivo de destino já existe! Error moving directory: @@ -273,6 +282,8 @@ A linha de comando é executada cada vez que: Erro ao escrever arquivo: Error reading file: Erro ao ler arquivo: +Operation aborted! +Operação cancelada! Endless loop when traversing directory: Loop infinito quando percorrendo diretório: Error traversing directory: @@ -413,24 +424,22 @@ A linha de comando é executada cada vez que: Cria um arquivo batch para sincronização automática. Para iniciar o modo batch, simplesmente dê um duplo click no arquivo ou execute via linha de comando: FreeFileSync.exe . Também pode ser agendado pelo agendador de tarefas do sistema operacional. Help Ajuda -Configuration overview: -Parâmetros de configuração: Filter files Filtrar arquivos -Status feedback -Informação do Status -Silent mode -Modo silencioso -Start minimized and write status information to a logfile -Iniciar minimizado e escrever informação de status em um arquivo de log Error handling Tratamento de erros Overview Parâmetros -Select logfile directory: -Escolha um diretório para salvar o arquivo de log: +Status feedback +Informação do Status +Run minimized + Maximum number of logfiles: Número máximo de arquivos de log: +Select logfile directory: +Escolha um diretório para salvar o arquivo de log: +Batch settings + &Save &Salvar &Load @@ -695,10 +704,6 @@ Transferir permissões de arquivos e diretórios Pares de pastas Select view Selecionar visualização -Folder Comparison and Synchronization -Comparação e Sincronização de Pastas -Recycle Bin not yet supported for this system! -Lixeira ainda não suportada por esse sistema! Set direction: Configurar direção Exclude temporarily @@ -733,6 +738,8 @@ Transferir permissões de arquivos e diretórios Salvar modificações para a configuração atual? Configuration loaded! Configuração carregada! +Folder Comparison and Synchronization +Comparação e Sincronização de Pastas Hide files that exist on left side only Ocultar arquivos que existem somente à esquerda Show files that exist on left side only @@ -941,10 +948,6 @@ Transferir permissões de arquivos e diretórios Configurando direções padrões de sincronização: Arquivos antigos serão substituídos por arquivos mais novos. The file does not contain a valid configuration: O arquivo não contém uma configuração válida: -Scanning: -Pesquisando: -Encoding extended time information: %x -Codificando informações adicionais de tempo: %x You can ignore this error to consider the directory as empty. Você pode ignorar esse erro para considerar o diretório como vazio. Directory does not exist: @@ -1021,8 +1024,6 @@ Transferir permissões de arquivos e diretórios Atualizando atributos de %x Source directory does not exist anymore: Diretório de origem não existe mais: -Generating database... -Gerando banco de dados... Nothing to synchronize according to configuration! Nada para sincronizar de acordo com a configuração! Target directory name must not be empty! @@ -1043,10 +1044,14 @@ Transferir permissões de arquivos e diretórios Espaço livre em disco requerido: Free disk space available: Espaço livre em disco: +Recycle Bin is not available for the following paths! Files will be deleted permanently instead: + A directory will be modified which is part of multiple folder pairs! Please review synchronization settings! Um diretório que faz parte de múltiplos pares de pastas será modificado! Por favor revise suas configurações de sincronização! Processing folder pair: Processando par de pastas: +Generating database... +Gerando banco de dados... Error copying locked file %x! Erro ao copiar arquivo bloqueado %x! Data verification error: Source and target file have different content! diff --git a/BUILD/Languages/romanian.lng b/BUILD/Languages/romanian.lng index 2c7da055..91e1f2e9 100644 --- a/BUILD/Languages/romanian.lng +++ b/BUILD/Languages/romanian.lng @@ -7,6 +7,8 @@ n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < 20)) ? 1 : 2 +Searching for directory %x... + Show in Explorer Arată în Explorator Open with default application @@ -17,8 +19,8 @@ RealtimeSync - Sincronizare Inteligentă Browse Explorează -Invalid commandline: "%x" -Linie de comandă nevalidă: "%x" +Invalid commandline: %x +Linie de comandă nevalidă: %x Error resolving symbolic link: Eroare la rezolvarea legăturii simbolice: Show popup @@ -110,10 +112,10 @@ Sincronizare inițială: One of the FreeFileSync database files is not yet existing: Una dintre părți nu are o filă de tip bază de date FreeFileSync: -One of the FreeFileSync database entries within the following file is not yet existing: -Una dintre intrările în baza de date FreeFileSync din fila următoare nu există: Error reading from synchronization database: Eroare la citirea din baza de date a sincronizării: +Database files do not share a common synchronization session: + An exception occurred! A apărut o excepție ! Error deleting file: @@ -137,6 +139,15 @@ Informații Fatal Error Eroare Fatală +Scanning: +Scanez: +Encoding extended time information: %x +Codarea informațiilor timpului extins: %x + +[1 Thread] +[%x Threads] + + Invalid FreeFileSync config file! Filă de configurare FreeFileSync nevalidă! File does not exist: @@ -234,20 +245,18 @@ Linia de comandă este executată de fiecare dată cînd: Monitorizare activă... Waiting for missing directories... Aștept ca dosarele lipsă să devină disponibile... -Could not initialize directory monitoring: -Nu pot inițializa monitorizarea dosarelor: A directory input field is empty. Cel puțin unul din dosarele de comparat este nespecificat. -Error when monitoring directories. -Eroare la monitorizarea dosarelor. Drag && drop Trage un dosar peste compartimentul de mai jos sau folosește butonul Explorează +Could not initialize directory monitoring: +Nu pot inițializa monitorizarea dosarelor: +Error when monitoring directories. +Eroare la monitorizarea dosarelor. Conversion error: Eroare de convertire: Error moving file: Eroare la mutarea filei: -Operation aborted! -Operație abandonată! Target file already existing! Fila țintă există deja! Error moving directory: @@ -278,6 +287,8 @@ Linia de comandă este executată de fiecare dată cînd: Eroare la scrierea filei: Error reading file: Eroare la citirea filei: +Operation aborted! +Operație abandonată! Endless loop when traversing directory: Buclă infinită la parcurgerea dosarului: Error traversing directory: @@ -418,24 +429,22 @@ Linia de comandă este executată de fiecare dată cînd: Poți crea o filă ce include un set de comenzi [batch file], în scopul folosirii ei la sincronizarea inteligentă. Pentru a porni în modul set, dublu-clichează fila sau execut-o folosind linia de comandă: FreeFileSync.exe . Această operație poate fi programată în planificatorul de sarcini al sistemului de operare [task scheduler]. Help Ajutor -Configuration overview: -Panorama Configurației: Filter files Filtru de File -Status feedback -Afișarea Stării -Silent mode -Mod silențios -Start minimized and write status information to a logfile -Pornește minimizat și scrie informațiile de stare într-un jurnal Error handling Gestionarea Erorilor Overview Panoramă -Select logfile directory: -Selectează un dosar pentru fila .log: +Status feedback +Afișarea Stării +Run minimized + Maximum number of logfiles: Numărul maxim de file jurnal: +Select logfile directory: +Selectează un dosar pentru fila .log: +Batch settings + &Save &Salvează &Load @@ -700,10 +709,6 @@ Transferă permisiunile filelor și dosarelor Perechi de Dosare Select view Selectează Vederea -Folder Comparison and Synchronization -Comparare și Sincronizare de Dosare -Recycle Bin not yet supported for this system! -Reciclatorul nu este încă suportat pentru acest sistem de operare! Set direction: Setează Acțiunea ca în Icoana Alăturată: Exclude temporarily @@ -738,6 +743,8 @@ Transferă permisiunile filelor și dosarelor Vrei să salvezi modificările configurației curente? Configuration loaded! Configurație încărcată ! +Folder Comparison and Synchronization +Comparare și Sincronizare de Dosare Hide files that exist on left side only Ascunde filele care există doar în stînga Show files that exist on left side only @@ -952,10 +959,6 @@ Transferă permisiunile filelor și dosarelor Baza de date existentă va fi făcută compatibilă cu versiunea softului și apoi va fi setat sensul implicit de sincronizare: Filele vechi vor fi suprascrise de cele noi. The file does not contain a valid configuration: Fila nu conține o configurație validă: -Scanning: -Scanez: -Encoding extended time information: %x -Codarea informațiilor timpului extins: %x You can ignore this error to consider the directory as empty. Poți ignora această eroare dacă vrei ca dosarul să fie considerat gol. Directory does not exist: @@ -1032,8 +1035,6 @@ Transferă permisiunile filelor și dosarelor Actualizez atributele lui %x Source directory does not exist anymore: Dosarul sursă nu mai există: -Generating database... -Generez baza de date... Nothing to synchronize according to configuration! Nu este nimic de sincronizat conform configurației! Target directory name must not be empty! @@ -1054,10 +1055,14 @@ Transferă permisiunile filelor și dosarelor Spațiu liber necesar: Free disk space available: Spațiu liber disponibil: +Recycle Bin is not available for the following paths! Files will be deleted permanently instead: + A directory will be modified which is part of multiple folder pairs! Please review synchronization settings! Va fi modificat un dosar care face parte din mai multe perechi de dosare! Reverifică setările de sincronizare! Processing folder pair: Procesez perechea de dosare: +Generating database... +Generez baza de date... Error copying locked file %x! Eroare la copierea filei zăvorîte %x! Data verification error: Source and target file have different content! diff --git a/BUILD/Languages/russian.lng b/BUILD/Languages/russian.lng index bd2a5e26..1fcbfa1b 100644 --- a/BUILD/Languages/russian.lng +++ b/BUILD/Languages/russian.lng @@ -7,6 +7,8 @@ n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<11 || n%100>14) ? 1 : 2 +Searching for directory %x... + Show in Explorer Показать в Проводнике Open with default application @@ -17,8 +19,8 @@ RealtimeSync - Автоматическая синхронизация Browse Обзор -Invalid commandline: "%x" -Неверная командная строка: "%x" +Invalid commandline: %x +Неверная командная строка: %x Error resolving symbolic link: Ошибка при решении символической ссылки: Show popup @@ -110,10 +112,10 @@ Первоначальная синхронизация: One of the FreeFileSync database files is not yet existing: Файла базы данных FreeFileSync еще не существует: -One of the FreeFileSync database entries within the following file is not yet existing: -Записей, относящихся к следующим файлам, в базе данных FreeFileSync еще не существует: Error reading from synchronization database: Ошибка при чтении из базы данных синхронизации: +Database files do not share a common synchronization session: + An exception occurred! Исключение произошло! Error deleting file: @@ -137,6 +139,15 @@ Информация Fatal Error Критическая ошибка +Scanning: +Сканирую: +Encoding extended time information: %x +Кодирование расширенной информации о времени: %x + +[1 Thread] +[%x Threads] + + Invalid FreeFileSync config file! Неверный файл конфигурации FreeFileSync! File does not exist: @@ -234,20 +245,18 @@ The command line is executed each time: Мониторинг включен... Waiting for missing directories... Ожидание пропущенных папок... -Could not initialize directory monitoring: -Не удалось инициализировать папку для мониторинга: A directory input field is empty. Поле ввода пути папки пустое. -Error when monitoring directories. -Ошибка при мониторинге папок. Drag && drop Drag && drop +Could not initialize directory monitoring: +Не удалось инициализировать папку для мониторинга: +Error when monitoring directories. +Ошибка при мониторинге папок. Conversion error: Ошибка преобразования: Error moving file: Ошибка перемещения файла: -Operation aborted! -Операция отменена! Target file already existing! Конечный файл уже существует! Error moving directory: @@ -278,6 +287,8 @@ The command line is executed each time: Ошибка при записи файла: Error reading file: Ошибка при чтении файла: +Operation aborted! +Операция отменена! Endless loop when traversing directory: Зацикливание при встрече пересекающихся путей: Error traversing directory: @@ -421,24 +432,22 @@ The command line is executed each time: Создайте файл пакетного задания для автоматической синхронизации. Для запуска в пакетном режиме просто дважды щелкните по файлу или выполните командную строку: FreeFileSync.exe . Также это может быть запланировано в планировщике задач операционной системы. Help Помощь -Configuration overview: -Настройки синхронизации: Filter files Фильтр файлов -Status feedback -Статус обратной связи -Silent mode -Скрытый режим -Start minimized and write status information to a logfile -Запускать свернутым и писать информацию о состоянии в лог-файл Error handling Обработка ошибок Overview Главная -Select logfile directory: -Выберите папку для лог-файлов: +Status feedback +Статус обратной связи +Run minimized + Maximum number of logfiles: Максимальное количество лог-файлов: +Select logfile directory: +Выберите папку для лог-файлов: +Batch settings + &Save &Сохранить &Load @@ -699,10 +708,6 @@ Transfer file and directory permissions Пары папок для синхронизации Select view Список файлов -Folder Comparison and Synchronization -Сравнение и синхронизация -Recycle Bin not yet supported for this system! -Корзина пока не поддерживается для этой системы! Set direction: Выберите направление: Exclude temporarily @@ -737,6 +742,8 @@ Transfer file and directory permissions Сохранить изменения в текущих настройках синхронизации? Configuration loaded! Настройки синхронизации загружены! +Folder Comparison and Synchronization +Сравнение и синхронизация Hide files that exist on left side only Скрыть файлы, существующие только слева Show files that exist on left side only @@ -957,10 +964,6 @@ Transfer file and directory permissions The file does not contain a valid configuration: Файл не содержит действительных настроек синхронизации: -Scanning: -Сканирую: -Encoding extended time information: %x -Кодирование расширенной информации о времени: %x You can ignore this error to consider the directory as empty. Вы можете проигнорировать ошибку, приняв папку за пустую. Directory does not exist: @@ -1037,8 +1040,6 @@ Transfer file and directory permissions Обновление атрибутов %x Source directory does not exist anymore: Исходная папка больше не существует: -Generating database... -Создание базы данных... Nothing to synchronize according to configuration! Ничего нет для синхронизации в соответствии с настройками синхронизации! Target directory name must not be empty! @@ -1059,10 +1060,14 @@ Transfer file and directory permissions Требуемое свободное место на диске: Free disk space available: Доступно свободного места на диске: +Recycle Bin is not available for the following paths! Files will be deleted permanently instead: + A directory will be modified which is part of multiple folder pairs! Please review synchronization settings! Папка, входящая в несколько пар папок, будет изменена. Пожалуйста, проверьте настройки синхронизации! Processing folder pair: Обработка пары папок: +Generating database... +Создание базы данных... Error copying locked file %x! Ошибка при копировании заблокированного файла %x! Data verification error: Source and target file have different content! diff --git a/BUILD/Languages/slovenian.lng b/BUILD/Languages/slovenian.lng index 63b482b1..4879ecef 100644 --- a/BUILD/Languages/slovenian.lng +++ b/BUILD/Languages/slovenian.lng @@ -7,6 +7,8 @@ n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3 +Searching for directory %x... + Show in Explorer Prikaži v Raziskovalcu Open with default application @@ -17,8 +19,8 @@ RealtimeSync - Avtomatizirana sinhronizacija Browse Brskaj -Invalid commandline: "%x" -Napačen ukaz v vrstici: "%x" +Invalid commandline: %x +Napačen ukaz v vrstici: %x Error resolving symbolic link: Napaka pri razreševanju simbolične povezave: Show popup @@ -111,10 +113,10 @@ Začetna sinhronizacija: One of the FreeFileSync database files is not yet existing: Ena od FreeFileSync datotek podatkovne baze še en obstaja: -One of the FreeFileSync database entries within the following file is not yet existing: -Eden od FreeFileSync vnosov v podatkovni bazi znotraj naslednje datoteke še ne obstaja: Error reading from synchronization database: Napaka pri branju iz sinhronizacijske podatkovne baze: +Database files do not share a common synchronization session: + An exception occurred! Zgodila se je napaka! Error deleting file: @@ -139,6 +141,15 @@ Info Fatal Error Usodna napaka +Scanning: +Pregledujem: +Encoding extended time information: %x +Podrobne informacije o času enkodiranja: %x + +[1 Thread] +[%x Threads] + + Invalid FreeFileSync config file! Neveljavna FreeFileSync nastavitvena datoteka! File does not exist: @@ -239,20 +250,18 @@ Ukazna vrstica se izvrši vsakič ko: Nadziranje aktivno... Waiting for missing directories... Čakam na manjkajoče imenike... -Could not initialize directory monitoring: -Ne morem začeti nadzorovanja imenikov: A directory input field is empty. Vpisno polje za imenik je prazno. -Error when monitoring directories. -Napaka pri nadzorovanju imenikov. Drag && drop Povleci && spusti +Could not initialize directory monitoring: +Ne morem začeti nadzorovanja imenikov: +Error when monitoring directories. +Napaka pri nadzorovanju imenikov. Conversion error: Napaka pri pretvorbi: Error moving file: Napaka pri premikanju datoteke: -Operation aborted! -Operacija prekinjena! Target file already existing! Ciljna datoteka že obstaja! Error moving directory: @@ -283,6 +292,8 @@ Ukazna vrstica se izvrši vsakič ko: Napaka pri pisanju datoteke: Error reading file: Napaka pri branju datoteke: +Operation aborted! +Operacija prekinjena! Endless loop when traversing directory: Neskončna zanka pri prehodu imenika: Error traversing directory: @@ -423,24 +434,22 @@ Ukazna vrstica se izvrši vsakič ko: Ustvari batch datoteko za avtomatizirano sinhronizacijo. Da začnete v batch načinu preprosto dvokliknite datoteko ali jo izvršite preko ukazne vrstice: FreeFileSync.exe . To se lahko nastavi v razpored opravil vašega operacijskega sistema. Help Pomoč -Configuration overview: -Pregled konfiguracije: Filter files Filtriraj datoteke -Status feedback -Povratne informacije statusa -Silent mode -Tihi način -Start minimized and write status information to a logfile -Zaženi pomanjšano in piši statusne informacije v datoteko za beleženje Error handling Napaka pri obravnavanju Overview Pregled -Select logfile directory: -Izberite imenik za datoteko beleženja: +Status feedback +Povratne informacije statusa +Run minimized + Maximum number of logfiles: Maksimalno število datotek beleženja: +Select logfile directory: +Izberite imenik za datoteko beleženja: +Batch settings + &Save &Shrani &Load @@ -705,10 +714,6 @@ Prenesi dovoljenja datotek in imenikov Pari map Select view Izberite pogled -Folder Comparison and Synchronization -Primerjava in sinhronizacija imenika -Recycle Bin not yet supported for this system! -Koš še ni podprt za ta sistem! Set direction: Nastavi smer: Exclude temporarily @@ -743,6 +748,8 @@ Prenesi dovoljenja datotek in imenikov Shranim spremembe trenutne konfiguracije? Configuration loaded! Konfiguracija naložena! +Folder Comparison and Synchronization +Primerjava in sinhronizacija imenika Hide files that exist on left side only Skrij datoteke, ki obstajajo samo na levi strani Show files that exist on left side only @@ -963,10 +970,6 @@ Prenesi dovoljenja datotek in imenikov Nastavljanje privzetih smeri sinhronizacije: Stare datoteke bodo prepisane z novimi datotekami. The file does not contain a valid configuration: Datoteka ne vsebuje veljavne konfiguracije: -Scanning: -Pregledujem: -Encoding extended time information: %x -Podrobne informacije o času enkodiranja: %x You can ignore this error to consider the directory as empty. To napako z obravnavanjem imenika kot praznega lahko ignorirate. Directory does not exist: @@ -1043,8 +1046,6 @@ Prenesi dovoljenja datotek in imenikov Posodabljam atribute od %x Source directory does not exist anymore: Izvorni imenik ne obstaja več: -Generating database... -Ustvarjam podatkovno bazo... Nothing to synchronize according to configuration! Po trenutni konfiguraciji ni nič za sinhronizirati! Target directory name must not be empty! @@ -1065,10 +1066,14 @@ Prenesi dovoljenja datotek in imenikov Potreben prostor na disku: Free disk space available: Prosti disk, ki je na voljo: +Recycle Bin is not available for the following paths! Files will be deleted permanently instead: + A directory will be modified which is part of multiple folder pairs! Please review synchronization settings! Imenik bo spremenjen, kar je del večkratnih parov map! Prosimo preglejte nastavitve sinhronizacije! Processing folder pair: Obdelujem par map: +Generating database... +Ustvarjam podatkovno bazo... Error copying locked file %x! Napaka pri kopiranju zaklenjene datoteke %x! Data verification error: Source and target file have different content! diff --git a/BUILD/Languages/spanish.lng b/BUILD/Languages/spanish.lng index e5b0be8b..cf6e7f1c 100644 --- a/BUILD/Languages/spanish.lng +++ b/BUILD/Languages/spanish.lng @@ -7,6 +7,8 @@ n == 1 ? 0 : 1 +Searching for directory %x... + Show in Explorer Mostrar en Explorer Open with default application @@ -17,8 +19,8 @@ RealtimeSync - Sincronización Automática Browse Examinar -Invalid commandline: "%x" -Línea de comandos inválida: "%x" +Invalid commandline: %x +Línea de comandos inválida: %x Error resolving symbolic link: Error al resolver enlace simbólico: Show popup @@ -109,10 +111,10 @@ Sincronización inicial: One of the FreeFileSync database files is not yet existing: Uno de los archivos de la base de datos de FreeFileSync aún no existe: -One of the FreeFileSync database entries within the following file is not yet existing: -Una de las entradas de la base de datos de FreeFileSync con el siguiente archivo aún no existe: Error reading from synchronization database: Error al leer de la base de datos de sincronización: +Database files do not share a common synchronization session: + An exception occurred! ¡Ha ocurrido una excepción! Error deleting file: @@ -135,6 +137,15 @@ Info Fatal Error Error fatal +Scanning: +Escanear: +Encoding extended time information: %x +Información temporal extendida de la codificación: %x + +[1 Thread] +[%x Threads] + + Invalid FreeFileSync config file! ¡Archivo de configuración de FreeFileSync inválido! File does not exist: @@ -229,20 +240,18 @@ La línea de comandos se ejecuta cada vez: Visualización activa... Waiting for missing directories... Esperando directorios faltantes... -Could not initialize directory monitoring: -No se ha podido inicializar la visualización de directorios: A directory input field is empty. Un campo de directorio está vacío. -Error when monitoring directories. -Error al visualizar los directorios. Drag && drop Arrastrar y soltar +Could not initialize directory monitoring: +No se ha podido inicializar la visualización de directorios: +Error when monitoring directories. +Error al visualizar los directorios. Conversion error: Error de conversión: Error moving file: Error al mover archivo: -Operation aborted! -¡Operación abortada! Target file already existing! ¡El archivo de destino ya existe! Error moving directory: @@ -273,6 +282,8 @@ La línea de comandos se ejecuta cada vez: Error al escribir archivo: Error reading file: Error al leer archivo: +Operation aborted! +¡Operación abortada! Endless loop when traversing directory: Bucle infinito al buscar en el directorio: Error traversing directory: @@ -413,24 +424,22 @@ La línea de comandos se ejecuta cada vez: Crear un archivo batch para la sincronización automática. Para iniciar el modo batch, simplemente hacer doble clic sobre el archivo o ejectuar mediante la línea de comandos: FreeFileSync.exe . También se puede programar en el planificador del tareas del sistema operativo. Help Ayuda -Configuration overview: -Visión global de la configuración: Filter files Filtrar archivos -Status feedback -Status feedback -Silent mode -Modo silencioso -Start minimized and write status information to a logfile -Iniciar minimizado y escribir información de estado en un registro Error handling Gestión de errores Overview Visión global -Select logfile directory: -Seleccione directorio para el archivo de registro: +Status feedback +Status feedback +Run minimized + Maximum number of logfiles: Número máximo de archivos de registro: +Select logfile directory: +Seleccione directorio para el archivo de registro: +Batch settings + &Save &Guardar &Load @@ -695,10 +704,6 @@ Transferir permisos de archivo y directorio Pares de carpetas Select view Sellecione vista -Folder Comparison and Synchronization -Comparación y Sincronización de Carpetas -Recycle Bin not yet supported for this system! -¡La papelera de reciclaje no esta soportada en este sistema! Set direction: Indicar dirección: Exclude temporarily @@ -733,6 +738,8 @@ Transferir permisos de archivo y directorio ¿Guardar los cambios de la configuración actual? Configuration loaded! ¡Configuración cargada! +Folder Comparison and Synchronization +Comparación y Sincronización de Carpetas Hide files that exist on left side only Ocultar archivos que existen sólo en el lado izquierdo Show files that exist on left side only @@ -941,10 +948,6 @@ Transferir permisos de archivo y directorio Fijando direcciones de sincronización por defecto: Los archivos viejos serán sobreescritos por los archivos nuevos. The file does not contain a valid configuration: El archivo no contiene una configuración válida: -Scanning: -Escanear: -Encoding extended time information: %x -Información temporal extendida de la codificación: %x You can ignore this error to consider the directory as empty. Puede ignorar este error al considerar el directorio como vacío. Directory does not exist: @@ -1021,8 +1024,6 @@ Transferir permisos de archivo y directorio Actualizar atributos de %x Source directory does not exist anymore: El directorio origen ya no existe: -Generating database... -Generando base de datos... Nothing to synchronize according to configuration! ¡Nada que sincronizar de acuerdo con la configuración! Target directory name must not be empty! @@ -1043,10 +1044,14 @@ Transferir permisos de archivo y directorio Espacio de disco necesario: Free disk space available: Espacio de disco disponible: +Recycle Bin is not available for the following paths! Files will be deleted permanently instead: + A directory will be modified which is part of multiple folder pairs! Please review synchronization settings! Un directorio será modificado, el cual es parte de mútiples pares de carpetas. ¡Por favor, revise la configuración de la sincronización! Processing folder pair: Procesar un par de carpetas: +Generating database... +Generando base de datos... Error copying locked file %x! ¡Error al copiar archivo bloqueado %x! Data verification error: Source and target file have different content! diff --git a/BUILD/Languages/swedish.lng b/BUILD/Languages/swedish.lng index 12a4784f..7ace3e68 100644 --- a/BUILD/Languages/swedish.lng +++ b/BUILD/Languages/swedish.lng @@ -7,6 +7,8 @@ n == 1 ? 0 : 1 +Searching for directory %x... + Show in Explorer Visa i Utforskaren Open with default application @@ -17,8 +19,8 @@ RealtimeSync - Automatiserad synkronisering Browse Bläddra -Invalid commandline: "%x" -Ogiltig kommandorad: "%x" +Invalid commandline: %x +Ogiltig kommandorad: %x Error resolving symbolic link: Kan inte tyda symbolisk länk: Show popup @@ -109,10 +111,10 @@ Initial synkronisering: One of the FreeFileSync database files is not yet existing: En av FreeFileSyncs databasfiler saknas: -One of the FreeFileSync database entries within the following file is not yet existing: -Ett av FreeFileSyncs databasobjekt saknas i följande fil: Error reading from synchronization database: Kan inte läsa från databasen: +Database files do not share a common synchronization session: + An exception occurred! Ett undantag inträffade! Error deleting file: @@ -135,6 +137,15 @@ Info Fatal Error Allvarligt fel +Scanning: +Skannar: +Encoding extended time information: %x +Kodar utökad tidsinformation: %x + +[1 Thread] +[%x Threads] + + Invalid FreeFileSync config file! Felaktig FreeFileSync konfigurationsfil! File does not exist: @@ -229,20 +240,18 @@ Kommandot verkställes när: Övervakning aktiverad... Waiting for missing directories... Väntar på saknade destinationer... -Could not initialize directory monitoring: -Kan inte initiera katalogskanner: A directory input field is empty. Ett katalogfält är tomt -Error when monitoring directories. -Fel vid övervakning av kataloger. Drag && drop Dra && släpp +Could not initialize directory monitoring: +Kan inte initiera katalogskanner: +Error when monitoring directories. +Fel vid övervakning av kataloger. Conversion error: Konversionsfel: Error moving file: Kan inte flytta fil: -Operation aborted! -Processen avbruten! Target file already existing! Filen finns redan! Error moving directory: @@ -273,6 +282,8 @@ Kommandot verkställes när: Kan inte skriva fil: Error reading file: Kan inte läsa fil: +Operation aborted! +Processen avbruten! Endless loop when traversing directory: Oändlig loop vid accessförsök på katalog: Error traversing directory: @@ -413,24 +424,22 @@ Kommandot verkställes när: Skapa en batch-fil för automatiserad synkronisering. För att starta i batch-läge, Dubbelklicka på filen eller starta den med kommandoraden: FreeFileSync.exe . Batch-filen kan också schemaläggas i Windows Schemaläggare. Help Hjälp -Configuration overview: -Översikt: Filter files Undantag -Status feedback -Status -Silent mode -Tyst läge -Start minimized and write status information to a logfile -Starta minimerad och skriv statusinformation till en loggfil Error handling Felhantering Overview Översikt -Select logfile directory: -Välj loggfilskatalog: +Status feedback +Status +Run minimized + Maximum number of logfiles: Max antal loggfiler: +Select logfile directory: +Välj loggfilskatalog: +Batch settings + &Save &Spara &Load @@ -695,10 +704,6 @@ Transfer file and directory permissions Katalogpar Select view Välj vy -Folder Comparison and Synchronization -Katalogjämförelse och synkronisering -Recycle Bin not yet supported for this system! -Stödet för papperskorg finns ännu inte i detta system Set direction: Ange riktning: Exclude temporarily @@ -733,6 +738,8 @@ Transfer file and directory permissions Vill du spara ändringarna i aktuella inställningar? Configuration loaded! Inställningar inlästa! +Folder Comparison and Synchronization +Katalogjämförelse och synkronisering Hide files that exist on left side only Visa inte filer som endast finns till vänster Show files that exist on left side only @@ -941,10 +948,6 @@ Transfer file and directory permissions Standardsynkronisering: Gamla filer kommer att skrivas över av nyare versioner. The file does not contain a valid configuration: Filen är ingen giltig konfigureringsfil: -Scanning: -Skannar: -Encoding extended time information: %x -Kodar utökad tidsinformation: %x You can ignore this error to consider the directory as empty. Du kan bortse från det här felet och utgå ifrån att katalogen är tom Directory does not exist: @@ -1021,8 +1024,6 @@ Transfer file and directory permissions Uppdaterar attribut för %x Source directory does not exist anymore: Källkatalogen finns inte längre: -Generating database... -Skapar databas... Nothing to synchronize according to configuration! Inget att synkronisera enligt aktuella inställningar! Target directory name must not be empty! @@ -1043,10 +1044,14 @@ Transfer file and directory permissions Krav på ledigt diskutrymme: Free disk space available: Ledigt diskutrymme: +Recycle Bin is not available for the following paths! Files will be deleted permanently instead: + A directory will be modified which is part of multiple folder pairs! Please review synchronization settings! En katalog som är en del av flera katalogpar kommer att ändras! Kontrollera synkroniseringsinställningarna Processing folder pair: Processar katalogpar: +Generating database... +Skapar databas... Error copying locked file %x! Kan inte kopiera låst fil %x! Data verification error: Source and target file have different content! diff --git a/BUILD/Languages/turkish.lng b/BUILD/Languages/turkish.lng index 4e0e6a33..6443596b 100644 --- a/BUILD/Languages/turkish.lng +++ b/BUILD/Languages/turkish.lng @@ -7,6 +7,8 @@ n == 1 ? 0 : 1 +Searching for directory %x... + Show in Explorer Tarayıcıda Göster Open with default application @@ -17,8 +19,8 @@ RealtimeSync - Kendiliğinden Eşleştirme Browse Gözat -Invalid commandline: "%x" -Geçersiz komut satırı: "%x" +Invalid commandline: %x +Geçersiz komut satırı: %x Error resolving symbolic link: Sembolik bağlantı çözümlenirken hata: Show popup @@ -109,10 +111,10 @@ Başlangıç eşleştirmesi: One of the FreeFileSync database files is not yet existing: FreeFileSync veritabanı dosyalarından biri henüz yok: -One of the FreeFileSync database entries within the following file is not yet existing: -Şu dosyadaki FreeFileSync veritabanı kayıtlarından biri henüz yok: Error reading from synchronization database: Eşleştirme veri tabanı okunurken hata: +Database files do not share a common synchronization session: + An exception occurred! Olağan dışı bir durum oluştu! Error deleting file: @@ -135,6 +137,15 @@ Bilgi Fatal Error Ölümcül Hata +Scanning: +Taranıyor: +Encoding extended time information: %x +Uzatılmış zaman bilgisi kodlanıyor: %x + +[1 Thread] +[%x Threads] + + Invalid FreeFileSync config file! Geçersiz FreeFileSync yapılandırma dosyası! File does not exist: @@ -229,20 +240,18 @@ Her seferinde çalıştırılacak komut satırı: İzleme etkin... Waiting for missing directories... Kayıp klasörler için bekleniyor... -Could not initialize directory monitoring: -Klasör izlemesi başlatılamadı: A directory input field is empty. Bir klasör giriş alanı boş -Error when monitoring directories. -Klasörler izlenirken hata. Drag && drop Klasör ya da dosyaları buraya sürükleyip bırakabilirsiniz +Could not initialize directory monitoring: +Klasör izlemesi başlatılamadı: +Error when monitoring directories. +Klasörler izlenirken hata. Conversion error: Dönüştürme hatası: Error moving file: Dosya taşınırken hata: -Operation aborted! -İşlemden vazgeçildi! Target file already existing! Hedef dosya zaten var! Error moving directory: @@ -273,6 +282,8 @@ Her seferinde çalıştırılacak komut satırı: Dosya yazılırken hata: Error reading file: Dosya okunurken hata: +Operation aborted! +İşlemden vazgeçildi! Endless loop when traversing directory: Klasörlerde dolaşırken sonsuz döngü: Error traversing directory: @@ -413,24 +424,22 @@ Her seferinde çalıştırılacak komut satırı: Kendiliğinden eşleştirme için bir komut dosyası oluşturun. Komut dosyasını işlemek için dosyanın üzerinde çift tıklayabilir ya da FreeFileSync.exe şeklinde bir komut satırı yazabilirsiniz. Bu işi işletim sisteminizin görev yöneticisi ile istediğiniz zaman çalışacak şekilde ayarlayabilirsiniz. Help Yardım -Configuration overview: -Yapılandırma özeti: Filter files Dosya süzgeci -Status feedback -Durum geri bildirimi -Silent mode -Sessiz kip -Start minimized and write status information to a logfile -Simge durumuna küçültülmüş olarak başlat ve durum bilgisini günlük dosyasına yaz Error handling Hata olduğunda: Overview Özet -Select logfile directory: -Kayıt dosyası klasörünü seçin: +Status feedback +Durum geri bildirimi +Run minimized + Maximum number of logfiles: En fazla günlük dosyası sayısı: +Select logfile directory: +Kayıt dosyası klasörünü seçin: +Batch settings + &Save &Kaydet &Load @@ -695,10 +704,6 @@ Dosya ve klasör izinlerini de aktar Klasör çiftleri Select view Görünümü seçin -Folder Comparison and Synchronization -Klasör Karşılaştırma ve Eşleştirme -Recycle Bin not yet supported for this system! -Geri Dönüşüm Kutusu bu sistemde desteklenmiyor! Set direction: Yönü seçin: Exclude temporarily @@ -733,6 +738,8 @@ Dosya ve klasör izinlerini de aktar Değişiklikleri şu anki yapılandırmaya kaydetmek ister misiniz? Configuration loaded! Yapılandırma yüklendi! +Folder Comparison and Synchronization +Klasör Karşılaştırma ve Eşleştirme Hide files that exist on left side only Yalnız sol yanda bulunan dosyaları gizle Show files that exist on left side only @@ -941,10 +948,6 @@ Dosya ve klasör izinlerini de aktar Varsayılan eşleştirme yönleri ayarlanıyor: Yeni dosyalar eski dosyaların üzerine yazılacak. The file does not contain a valid configuration: Dosya geçerli bir yapılandırma içermiyor: -Scanning: -Taranıyor: -Encoding extended time information: %x -Uzatılmış zaman bilgisi kodlanıyor: %x You can ignore this error to consider the directory as empty. Bu hatayı, klasörü boş sayacak şekilde yok sayabilirsiniz. Directory does not exist: @@ -1021,8 +1024,6 @@ Dosya ve klasör izinlerini de aktar %x öznitelikleri güncelleniyor Source directory does not exist anymore: Kaynak klasör artık yok: -Generating database... -Veri tabanı oluşturuluyor... Nothing to synchronize according to configuration! Yapılandırmaya göre eşleştirilecek bir şey yok! Target directory name must not be empty! @@ -1043,10 +1044,14 @@ Dosya ve klasör izinlerini de aktar Gereken boş disk alanı: Free disk space available: Kullanılabilir disk alanı: +Recycle Bin is not available for the following paths! Files will be deleted permanently instead: + A directory will be modified which is part of multiple folder pairs! Please review synchronization settings! Çoklu klasör çiftlerinin bir parçası olduğan bir klasör düzenlenecek! Lütfen eşleştirme ayarlarınızı gözden geçirin! Processing folder pair: İşlenen klasör çifti: +Generating database... +Veri tabanı oluşturuluyor... Error copying locked file %x! Kilitli dosya %x kopyalanırken hata! Data verification error: Source and target file have different content! diff --git a/BUILD/Languages/ukrainian.lng b/BUILD/Languages/ukrainian.lng index ee2b3cc6..23b8c06d 100644 --- a/BUILD/Languages/ukrainian.lng +++ b/BUILD/Languages/ukrainian.lng @@ -7,6 +7,8 @@ n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2 +Searching for directory %x... + Show in Explorer Показати у Провіднику Open with default application @@ -17,8 +19,8 @@ RealtimeSync - Автоматична синхронізація Browse Переглянути -Invalid commandline: "%x" -Неправильний командний рядок: "%x" +Invalid commandline: %x +Неправильний командний рядок: %x Error resolving symbolic link: Помилка при вирішені символічного посилання: Show popup @@ -110,10 +112,10 @@ Вступна синхронізація: One of the FreeFileSync database files is not yet existing: Файла бази даних FreeFileSync ще не існує: -One of the FreeFileSync database entries within the following file is not yet existing: -Записів, які стосуються таких файлів, в базі даних FreeFileSync ще не існує: Error reading from synchronization database: Помилка при читанні з бази даних синхронізації: +Database files do not share a common synchronization session: + An exception occurred! Відбулось виключення! Error deleting file: @@ -137,6 +139,15 @@ Інформація Fatal Error Критична помилка +Scanning: +Сканую: +Encoding extended time information: %x +Кодування розширеної інформації про час: %x + +[1 Thread] +[%x Threads] + + Invalid FreeFileSync config file! Неправильний файл конфігурації FreeFileSync! File does not exist: @@ -234,20 +245,18 @@ The command line is executed each time: Моніторинг включений... Waiting for missing directories... Очікування пропущених каталогів... -Could not initialize directory monitoring: -Не вдалося ініціювати каталог для моніторингу: A directory input field is empty. Поле введення шляху каталога порожнє. -Error when monitoring directories. -Помилка моніторингу каталогу. Drag && drop Drag && drop +Could not initialize directory monitoring: +Не вдалося ініціювати каталог для моніторингу: +Error when monitoring directories. +Помилка моніторингу каталогу. Conversion error: Помилка перетворення: Error moving file: Помилка переміщення файла: -Operation aborted! -Операція відмінена! Target file already existing! Кінцевий файл уже існує! Error moving directory: @@ -278,6 +287,8 @@ The command line is executed each time: Помилка при записі файла: Error reading file: Помилка при читанні файла: +Operation aborted! +Операція відмінена! Endless loop when traversing directory: Зациклюванння при обході каталогу: Error traversing directory: @@ -421,24 +432,22 @@ The command line is executed each time: Створити пакетний файл для автоматичної синхронізації. Щоб запустити пакетний режим просто двічі клацніть файл або виконайте командний рядок: FreeFileSync.exe . Це можна також запланувати в менеджері ОС Help Допомога -Configuration overview: -Огляд конфігурації: Filter files Фільтр файлів -Status feedback -Статус оберненого зв’язку -Silent mode -Тихий режим роботи -Start minimized and write status information to a logfile -Запускати згорнутим і записувати інформацію про стан в лог-файл Error handling Обробка помилок Overview Головна -Select logfile directory: -Виберіть каталог для лог-файлів: +Status feedback +Статус оберненого зв’язку +Run minimized + Maximum number of logfiles: Максимальна кількість лог-файлів: +Select logfile directory: +Виберіть каталог для лог-файлів: +Batch settings + &Save &Зберегти &Load @@ -699,10 +708,6 @@ Transfer file and directory permissions Пари папок Select view Список файлів -Folder Comparison and Synchronization -Порівнювання і синхронізація папок -Recycle Bin not yet supported for this system! -Корзина не підтримується у цій системі! Set direction: Виберіть напрям: Exclude temporarily @@ -737,6 +742,8 @@ Transfer file and directory permissions Зберегти зміни в активних налаштуваннях? Configuration loaded! Налаштування синхронізації загружено! +Folder Comparison and Synchronization +Порівнювання і синхронізація папок Hide files that exist on left side only Приховати файли, які є тільки ліворуч Show files that exist on left side only @@ -954,10 +961,6 @@ Transfer file and directory permissions The file does not contain a valid configuration: Файл не містить правильних налаштувань синхронізації: -Scanning: -Сканую: -Encoding extended time information: %x -Кодування розширеної інформації про час: %x You can ignore this error to consider the directory as empty. Ви можете проігнорувати помилку, вважаючи каталог порожнім. Directory does not exist: @@ -1034,8 +1037,6 @@ Transfer file and directory permissions Оновлення атрибутів %x Source directory does not exist anymore: Каталог-джерело вже не існує: -Generating database... -Створення бази даних... Nothing to synchronize according to configuration! Нічого синхронізувати згідно з налаштуваннями синхронізації! Target directory name must not be empty! @@ -1056,10 +1057,14 @@ Transfer file and directory permissions Потрібне вільне місце на диску: Free disk space available: Доступно вільного місця на диску: +Recycle Bin is not available for the following paths! Files will be deleted permanently instead: + A directory will be modified which is part of multiple folder pairs! Please review synchronization settings! Каталог, який є частиною декількох пар папок, буде змінений. Будь ласка, перевірте налаштування синхронізації! Processing folder pair: Обробка пари папок: +Generating database... +Створення бази даних... Error copying locked file %x! Помилка при копіюванні заблокованого файла %x! Data verification error: Source and target file have different content! diff --git a/BUILD/Resources.dat b/BUILD/Resources.dat index a88b0703..357e14f7 100644 Binary files a/BUILD/Resources.dat and b/BUILD/Resources.dat differ diff --git a/FreeFileSync - wxWidgets v2.9.2 Beta.vcxproj b/FreeFileSync - wxWidgets v2.9.2 Beta.vcxproj index 5a878c54..541209c0 100644 --- a/FreeFileSync - wxWidgets v2.9.2 Beta.vcxproj +++ b/FreeFileSync - wxWidgets v2.9.2 Beta.vcxproj @@ -256,7 +256,6 @@ - diff --git a/FreeFileSync.cbp b/FreeFileSync.cbp index 53917e8d..861db2be 100644 --- a/FreeFileSync.cbp +++ b/FreeFileSync.cbp @@ -96,6 +96,7 @@ + @@ -123,6 +124,7 @@ + @@ -160,6 +162,7 @@ + @@ -203,6 +206,8 @@ + + - @@ -180,6 +181,7 @@ true false Default + $(SolutionDir)shared/warn_static.h; Windows @@ -215,6 +217,7 @@ true false true + $(SolutionDir)shared/warn_static.h; Windows @@ -251,12 +254,12 @@ + - diff --git a/Makefile b/Makefile index 976ff95e..641fa974 100644 --- a/Makefile +++ b/Makefile @@ -20,13 +20,21 @@ endif #support for GTKMM -FFS_CPPFLAGS+=`pkg-config --cflags gtkmm-2.4` -LINKFLAGS+=`pkg-config --libs gtkmm-2.4` +FFS_CPPFLAGS += `pkg-config --cflags gtkmm-2.4` +LINKFLAGS += `pkg-config --libs gtkmm-2.4` #support for SELinux (optional) SELINUX_EXISTING=$(shell pkg-config --exists libselinux && echo YES) ifeq ($(SELINUX_EXISTING),YES) -FFS_CPPFLAGS += -DHAVE_SELINUX +FFS_CPPFLAGS += `pkg-config --cflags libselinux ` -DHAVE_SELINUX +LINKFLAGS += `pkg-config --libs libselinux` +endif + +#support for Ubuntu Unity (optional) +UNITY_EXISTING=$(shell pkg-config --exists unity && echo YES) +ifeq ($(UNITY_EXISTING),YES) +FFS_CPPFLAGS += `pkg-config --cflags unity` -DHAVE_UBUNTU_UNITY +LINKFLAGS += `pkg-config --libs unity` endif FILE_LIST= #internal list of all *.cpp files needed for compilation @@ -50,6 +58,7 @@ FILE_LIST+=ui/search.cpp FILE_LIST+=ui/switch_to_gui.cpp FILE_LIST+=ui/msg_popup.cpp FILE_LIST+=ui/progress_indicator.cpp +FILE_LIST+=library/parallel_scan.cpp FILE_LIST+=library/custom_grid.cpp FILE_LIST+=library/error_log.cpp FILE_LIST+=library/status_handler.cpp @@ -65,10 +74,10 @@ FILE_LIST+=library/dir_lock.cpp FILE_LIST+=shared/i18n.cpp FILE_LIST+=shared/localization.cpp FILE_LIST+=shared/file_io.cpp +FILE_LIST+=shared/taskbar.cpp FILE_LIST+=shared/dir_name.cpp FILE_LIST+=shared/guid.cpp FILE_LIST+=shared/xml_base.cpp -FILE_LIST+=shared/check_exist.cpp FILE_LIST+=shared/last_error.cpp FILE_LIST+=shared/custom_tooltip.cpp FILE_LIST+=shared/file_handling.cpp diff --git a/RealtimeSync/RealtimeSync.cbp b/RealtimeSync/RealtimeSync.cbp index 867b898c..8464abfc 100644 --- a/RealtimeSync/RealtimeSync.cbp +++ b/RealtimeSync/RealtimeSync.cbp @@ -92,6 +92,7 @@ + @@ -122,7 +123,6 @@ - @@ -154,6 +154,7 @@ + diff --git a/RealtimeSync/RealtimeSync.vcxproj b/RealtimeSync/RealtimeSync.vcxproj index cdeb18b4..5936b74c 100644 --- a/RealtimeSync/RealtimeSync.vcxproj +++ b/RealtimeSync/RealtimeSync.vcxproj @@ -106,7 +106,7 @@ false false $(IntDir)pch.obj - $(ProjectDir)/../shared/pch.h + $(SolutionDir)shared/warn_static.h;$(ProjectDir)/../shared/pch.h EditAndContinue @@ -136,7 +136,7 @@ false false $(IntDir)pch.obj - $(ProjectDir)/../shared/pch.h + $(SolutionDir)shared/warn_static.h;$(ProjectDir)/../shared/pch.h ProgramDatabase true @@ -169,6 +169,7 @@ MultiThreaded true false + $(SolutionDir)shared/warn_static.h; Windows @@ -204,6 +205,7 @@ true false true + $(SolutionDir)shared/warn_static.h; Windows @@ -226,7 +228,6 @@ - diff --git a/RealtimeSync/application.cpp b/RealtimeSync/application.cpp index 196e0ecc..6b7e81e9 100644 --- a/RealtimeSync/application.cpp +++ b/RealtimeSync/application.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "application.h" #include "main_dlg.h" #include diff --git a/RealtimeSync/application.h b/RealtimeSync/application.h index a8a931e0..6b5481ad 100644 --- a/RealtimeSync/application.h +++ b/RealtimeSync/application.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef REALTIMESYNCAPP_H #define REALTIMESYNCAPP_H diff --git a/RealtimeSync/main_dlg.cpp b/RealtimeSync/main_dlg.cpp index 860ddcef..e8851428 100644 --- a/RealtimeSync/main_dlg.cpp +++ b/RealtimeSync/main_dlg.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "main_dlg.h" #include "resources.h" #include "../shared/custom_button.h" diff --git a/RealtimeSync/main_dlg.h b/RealtimeSync/main_dlg.h index 2ce04557..54d4d50c 100644 --- a/RealtimeSync/main_dlg.h +++ b/RealtimeSync/main_dlg.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef REALTIMESYNCMAIN_H #define REALTIMESYNCMAIN_H diff --git a/RealtimeSync/makefile b/RealtimeSync/makefile index 2e123af2..3bc19061 100644 --- a/RealtimeSync/makefile +++ b/RealtimeSync/makefile @@ -27,7 +27,6 @@ FILE_LIST+=xml_ffs.cpp FILE_LIST+=../library/process_xml.cpp FILE_LIST+=../structures.cpp FILE_LIST+=../shared/util.cpp -FILE_LIST+=../shared/check_exist.cpp FILE_LIST+=../shared/i18n.cpp FILE_LIST+=../shared/localization.cpp FILE_LIST+=../shared/dir_watcher.cpp diff --git a/RealtimeSync/resources.cpp b/RealtimeSync/resources.cpp index 3f7f7988..e9231623 100644 --- a/RealtimeSync/resources.cpp +++ b/RealtimeSync/resources.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "resources.h" #include #include diff --git a/RealtimeSync/resources.h b/RealtimeSync/resources.h index 1237c811..fec82358 100644 --- a/RealtimeSync/resources.h +++ b/RealtimeSync/resources.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef RESOURCES_H_INCLUDED #define RESOURCES_H_INCLUDED diff --git a/RealtimeSync/tray_menu.cpp b/RealtimeSync/tray_menu.cpp index e6d5f0d4..98c66cb5 100644 --- a/RealtimeSync/tray_menu.cpp +++ b/RealtimeSync/tray_menu.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "tray_menu.h" #include #include @@ -299,8 +299,8 @@ rts::MonitorResponse rts::startDirectoryMonitor(const xmlAccess::XmlRealConfig& if (config.commandline.empty()) { - std::wstring errorMsg = _("Invalid commandline: \"%x\""); - replace(errorMsg, L"%x", config.commandline); + std::wstring errorMsg = _("Invalid commandline: %x"); + replace(errorMsg, L"%x", L"\"" + config.commandline + L"\""); throw FileError(errorMsg); } diff --git a/RealtimeSync/tray_menu.h b/RealtimeSync/tray_menu.h index 01fbba17..80f2d26c 100644 --- a/RealtimeSync/tray_menu.h +++ b/RealtimeSync/tray_menu.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef TRAYMENU_H_INCLUDED #define TRAYMENU_H_INCLUDED diff --git a/RealtimeSync/watcher.cpp b/RealtimeSync/watcher.cpp index 059f420b..b17c63ba 100644 --- a/RealtimeSync/watcher.cpp +++ b/RealtimeSync/watcher.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "watcher.h" #include "../shared/file_handling.h" #include "../shared/i18n.h" @@ -120,13 +120,13 @@ rts::WaitResult rts::waitForChanges(const std::vector& dirNames, WaitCa if (!changedFiles.empty()) { -/* - std::for_each(changedFiles.begin(), changedFiles.end(), - [](const Zstring& fn) { wxMessageBox(toWx(fn));}); + /* + std::for_each(changedFiles.begin(), changedFiles.end(), + [](const Zstring& fn) { wxMessageBox(toWx(fn));}); - const wxString filename = toWx(changedFiles[0]); - ::wxSetEnv(wxT("RTS_CHANGE"), filename); -*/ + const wxString filename = toWx(changedFiles[0]); + ::wxSetEnv(wxT("RTS_CHANGE"), filename); + */ return CHANGE_DETECTED; //directory change detected } diff --git a/RealtimeSync/watcher.h b/RealtimeSync/watcher.h index 7208e7fb..04a0d860 100644 --- a/RealtimeSync/watcher.h +++ b/RealtimeSync/watcher.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef WATCHER_H_INCLUDED #define WATCHER_H_INCLUDED diff --git a/RealtimeSync/xml_ffs.cpp b/RealtimeSync/xml_ffs.cpp index 3424dea2..ed0a4331 100644 --- a/RealtimeSync/xml_ffs.cpp +++ b/RealtimeSync/xml_ffs.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "xml_ffs.h" #include "../shared/standard_paths.h" #include "../shared/global_func.h" diff --git a/RealtimeSync/xml_ffs.h b/RealtimeSync/xml_ffs.h index fb48712a..f359c039 100644 --- a/RealtimeSync/xml_ffs.h +++ b/RealtimeSync/xml_ffs.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef XMLFREEFILESYNC_H_INCLUDED #define XMLFREEFILESYNC_H_INCLUDED diff --git a/RealtimeSync/xml_proc.cpp b/RealtimeSync/xml_proc.cpp index e3d7f270..b9839f9c 100644 --- a/RealtimeSync/xml_proc.cpp +++ b/RealtimeSync/xml_proc.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "xml_proc.h" #include #include "../shared/i18n.h" diff --git a/RealtimeSync/xml_proc.h b/RealtimeSync/xml_proc.h index 3e2549b0..37d2e029 100644 --- a/RealtimeSync/xml_proc.h +++ b/RealtimeSync/xml_proc.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef XMLPROCESSING_H_INCLUDED #define XMLPROCESSING_H_INCLUDED diff --git a/algorithm.cpp b/algorithm.cpp index cfc2997a..a059e693 100644 --- a/algorithm.cpp +++ b/algorithm.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "algorithm.h" #include #include @@ -1265,8 +1265,8 @@ private: void zen::addHardFiltering(BaseDirMapping& baseMap, const Zstring& excludeFilter) { - ApplyHardFilter(*HardFilter::FilterRef( - new NameFilter(FilterConfig().includeFilter, excludeFilter))).execute(baseMap); + ApplyHardFilter(*HardFilter::FilterRef( + new NameFilter(FilterConfig().includeFilter, excludeFilter))).execute(baseMap); } diff --git a/algorithm.h b/algorithm.h index ad5d2e30..16bb11eb 100644 --- a/algorithm.h +++ b/algorithm.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef ALGORITHM_H_INCLUDED #define ALGORITHM_H_INCLUDED diff --git a/comparison.cpp b/comparison.cpp index 0f2b1dab..74742898 100644 --- a/comparison.cpp +++ b/comparison.cpp @@ -3,29 +3,19 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "comparison.h" -#include +#include "library/parallel_scan.h" +#include "shared/resolve_path.h" +#include "shared/i18n.h" #include -#include -#include "shared/global_func.h" +#include "library/dir_exist_async.h" +#include "shared/string_conv.h" #include "shared/loki/ScopeGuard.h" -#include "shared/i18n.h" -#include -#include -#include +#include "library/binary.h" #include "algorithm.h" #include "shared/util.h" -#include "shared/string_conv.h" -#include "shared/file_handling.h" -#include "shared/resolve_path.h" -#include "shared/last_error.h" -#include "shared/file_traverser.h" -#include "file_hierarchy.h" -#include "library/binary.h" #include "library/cmp_filetime.h" -#include "library/lock_holder.h" -#include "library/db_file.h" #ifdef FFS_WIN #include "shared/perf.h" @@ -34,7 +24,7 @@ using namespace zen; -std::vector zen::extractCompareCfg(const MainConfiguration& mainCfg) +std::vector zen::extractCompareCfg(const MainConfiguration& mainCfg) { //merge first and additional pairs std::vector allPairs; @@ -46,374 +36,41 @@ std::vector zen::extractCompareCfg(const MainConfiguration& std::vector output; std::transform(allPairs.begin(), allPairs.end(), std::back_inserter(output), [&](const FolderPairEnh& enhPair) -> FolderPairCfg - { - return FolderPairCfg(getFormattedDirectoryName(enhPair.leftDirectory), //ensure they end with FILE_NAME_SEPARATOR and replace macros - getFormattedDirectoryName(enhPair.rightDirectory), - normalizeFilters(mainCfg.globalFilter, enhPair.localFilter), - mainCfg.handleSymlinks, - enhPair.altSyncConfig.get() ? enhPair.altSyncConfig->syncConfiguration : mainCfg.syncConfiguration); - }); - return output; -} - - -class DirCallback; - -struct TraverserConfig -{ -public: - TraverserConfig(SymLinkHandling handleSymlinks, - const HardFilter::FilterRef& filter, - std::set& failedReads, - ProcessCallback& handler) : - handleSymlinks_(handleSymlinks), - textScanning(toZ(_("Scanning:")) + Zstr(" \n")), - filterInstance(filter), - statusHandler(handler), - failedReads_(failedReads) {} - - typedef std::shared_ptr CallbackPointer; - std::vector callBackBox; //collection of callback pointers to handle ownership - - const SymLinkHandling handleSymlinks_; - const Zstring textScanning; - const HardFilter::FilterRef filterInstance; //always bound! - ProcessCallback& statusHandler; - - std::set& failedReads_; //relative postfixed names of directories that could not be read (empty for root) -}; - - -class DirCallback : public zen::TraverseCallback -{ -public: - DirCallback(TraverserConfig& config, - const Zstring& relNameParentPf, //postfixed with FILE_NAME_SEPARATOR! - DirContainer& output) : - cfg(config), - relNameParentPf_(relNameParentPf), - output_(output) {} - - virtual void onFile (const Zchar* shortName, const Zstring& fullName, const FileInfo& details); - virtual void onSymlink(const Zchar* shortName, const Zstring& fullName, const SymlinkInfo& details); - virtual ReturnValDir onDir (const Zchar* shortName, const Zstring& fullName); - virtual HandleError onError (const std::wstring& errorText); - -private: - TraverserConfig& cfg; - const Zstring relNameParentPf_; - DirContainer& output_; -}; - - -void DirCallback::onFile(const Zchar* shortName, const Zstring& fullName, const FileInfo& details) -{ - const Zstring fileNameShort = shortName; - - //do not list the database file(s) sync.ffs_db, sync.x64.ffs_db, etc. or lock files - if (endsWith(fileNameShort, SYNC_DB_FILE_ENDING) || - endsWith(fileNameShort, LOCK_FILE_ENDING)) - return; - - //assemble status message (performance optimized) = textScanning + wxT("\"") + fullName + wxT("\"") - Zstring statusText = cfg.textScanning; - statusText.reserve(statusText.length() + fullName.length() + 2); - statusText += Zchar('\"'); - statusText += fullName; - statusText += Zchar('\"'); - - //update UI/commandline status information - cfg.statusHandler.reportInfo(utf8CvrtTo(statusText)); - - //------------------------------------------------------------------------------------ - //apply filter before processing (use relative name!) - if (!cfg.filterInstance->passFileFilter(relNameParentPf_ + fileNameShort)) - return; - - //warning: for windows retrieveFileID is slow as hell! approximately 3 * 10^-4 s per file! - //therefore only large files (that take advantage of detection of renaming when synchronizing) should be evaluated! - //testcase: scanning only files larger than 1 MB results in performance loss of 6% - - //#warning this call is NOT acceptable for Linux! - // //Linux: retrieveFileID takes about 50% longer in VM! (avoidable because of redundant stat() call!) - // const util::FileID fileIdentifier = details.fileSize >= cfg.detectRenameThreshold_ ? - // util::retrieveFileID(fullName) : - // util::FileID(); - - output_.addSubFile(fileNameShort, FileDescriptor(details.lastWriteTimeRaw, details.fileSize)); - - //add 1 element to the progress indicator - cfg.statusHandler.updateProcessedData(1, 0); //NO performance issue at all - cfg.statusHandler.requestUiRefresh(); //may throw -} - - -void DirCallback::onSymlink(const Zchar* shortName, const Zstring& fullName, const SymlinkInfo& details) -{ - if (cfg.handleSymlinks_ == SYMLINK_IGNORE) - return; - - //assemble status message (performance optimized) = textScanning + wxT("\"") + fullName + wxT("\"") - Zstring statusText = cfg.textScanning; - statusText.reserve(statusText.length() + fullName.length() + 2); - statusText += Zchar('\"'); - statusText += fullName; - statusText += Zchar('\"'); - - //update UI/commandline status information - cfg.statusHandler.reportInfo(utf8CvrtTo(statusText)); - - //------------------------------------------------------------------------------------ - const Zstring& relName = relNameParentPf_ + shortName; - - //apply filter before processing (use relative name!) - if (!cfg.filterInstance->passFileFilter(relName)) //always use file filter: Link type may not be "stable" on Linux! - return; - - output_.addSubLink(shortName, LinkDescriptor(details.lastWriteTimeRaw, details.targetPath, details.dirLink ? LinkDescriptor::TYPE_DIR : LinkDescriptor::TYPE_FILE)); - - //add 1 element to the progress indicator - cfg.statusHandler.updateProcessedData(1, 0); //NO performance issue at all - cfg.statusHandler.requestUiRefresh(); //may throw -} - - -TraverseCallback::ReturnValDir DirCallback::onDir(const Zchar* shortName, const Zstring& fullName) -{ - //assemble status message (performance optimized) = textScanning + wxT("\"") + fullName + wxT("\"") - Zstring statusText = cfg.textScanning; - statusText.reserve(statusText.length() + fullName.length() + 2); - statusText += Zchar('\"'); - statusText += fullName; - statusText += Zchar('\"'); - - //update UI/commandline status information - cfg.statusHandler.reportInfo(utf8CvrtTo(statusText)); - - //------------------------------------------------------------------------------------ - const Zstring& relName = relNameParentPf_ + shortName; - - //apply filter before processing (use relative name!) - bool subObjMightMatch = true; - if (!cfg.filterInstance->passDirFilter(relName, &subObjMightMatch)) - { - if (!subObjMightMatch) - return Loki::Int2Type(); //do NOT traverse subdirs - } - else - { - cfg.statusHandler.updateProcessedData(1, 0); //NO performance issue at all - cfg.statusHandler.requestUiRefresh(); //may throw - } - - DirContainer& subDir = output_.addSubDir(shortName); - - TraverserConfig::CallbackPointer subDirCallback = std::make_shared(cfg, relName + FILE_NAME_SEPARATOR, subDir); - cfg.callBackBox.push_back(subDirCallback); //handle lifetime - //attention: ensure directory filtering is applied later to exclude actually filtered directories - return ReturnValDir(Loki::Int2Type(), *subDirCallback.get()); -} - - -DirCallback::HandleError DirCallback::onError(const std::wstring& errorText) -{ - switch (cfg.statusHandler.reportError(errorText)) - { - case ProcessCallback::IGNORE_ERROR: - cfg.failedReads_.insert(relNameParentPf_); - return TRAV_ERROR_IGNORE; - - case ProcessCallback::RETRY: - return TRAV_ERROR_RETRY; - } - - assert(false); - return TRAV_ERROR_IGNORE; -} - - -//------------------------------------------------------------------------------------------ -struct DirBufferKey -{ - DirBufferKey(const Zstring& dirname, - const HardFilter::FilterRef& filterIn, //filter interface: always bound by design! - SymLinkHandling handleSymlinks) : - directoryName(dirname), - filter(filterIn), - handleSymlinks_(handleSymlinks) {} - - const Zstring directoryName; - const HardFilter::FilterRef filter; - const SymLinkHandling handleSymlinks_; - - bool operator<(const DirBufferKey& other) const - { - if (handleSymlinks_ != other.handleSymlinks_) - return handleSymlinks_ < other.handleSymlinks_; - - if (!EqualFilename()(directoryName, other.directoryName)) - return LessFilename()(directoryName, other.directoryName); - - return *filter < *other.filter; - } -}; - - -struct DirBufferValue -{ - DirContainer dirCont; - std::set failedReads; //relative postfixed names of directories that could not be read (empty for root), e.g. access denied, or temporal network drop -}; - - -//------------------------------------------------------------------------------------------ -class CompareProcess::DirectoryBuffer //buffer multiple scans of the same directories -{ -public: - DirectoryBuffer(ProcessCallback& procCallback) : - procCallback_(procCallback) {} - - const DirBufferValue& getDirectoryDescription(const Zstring& directoryPostfixed, const HardFilter::FilterRef& filter, SymLinkHandling handleSymlinks) { - const DirBufferKey searchKey(directoryPostfixed, filter, handleSymlinks); - - auto iter = buffer.find(searchKey); - if (iter != buffer.end()) - return iter->second; //entry found in buffer; return - else - return insertIntoBuffer(searchKey); //entry not found; create new one - } - -private: - typedef std::map BufferType; - - DirBufferValue& insertIntoBuffer(const DirBufferKey& newKey); - - BufferType buffer; - - ProcessCallback& procCallback_; -}; -//------------------------------------------------------------------------------------------ - - -#ifdef FFS_WIN -class DstHackCallbackImpl : public DstHackCallback -{ -public: - DstHackCallbackImpl(ProcessCallback& procCallback) : - textApplyingDstHack(toZ(_("Encoding extended time information: %x")).Replace(Zstr("%x"), Zstr("\n\"%x\""))), - procCallback_(procCallback) {} - -private: - virtual void requestUiRefresh(const Zstring& filename) //applying DST hack imposes significant one-time performance drawback => callback to inform user - { - Zstring statusText = textApplyingDstHack; - statusText.Replace(Zstr("%x"), filename); - procCallback_.reportInfo(utf8CvrtTo(statusText)); - } - - const Zstring textApplyingDstHack; - ProcessCallback& procCallback_; -}; -#endif - - -DirBufferValue& CompareProcess::DirectoryBuffer::insertIntoBuffer(const DirBufferKey& newKey) -{ - DirBufferValue& bufferVal = buffer[newKey]; //default construct value - - if (!newKey.directoryName.empty() && - zen::dirExists(newKey.directoryName)) //folder existence already checked in startCompareProcess(): do not treat as error when arriving here! - { - TraverserConfig travCfg(newKey.handleSymlinks_, //shared by all(!) instances of DirCallback while traversing a folder hierarchy - newKey.filter, - bufferVal.failedReads, - procCallback_); - - DirCallback traverser(travCfg, - Zstring(), - bufferVal.dirCont); - - bool followSymlinks = false; - switch (newKey.handleSymlinks_) - { - case SYMLINK_IGNORE: - followSymlinks = false; //=> symlinks will be reported via onSymlink() where they are excluded - break; - case SYMLINK_USE_DIRECTLY: - followSymlinks = false; - break; - case SYMLINK_FOLLOW_LINK: - followSymlinks = true; - break; - } - - DstHackCallback* dstCallbackPtr = NULL; -#ifdef FFS_WIN - DstHackCallbackImpl dstCallback(procCallback_); - dstCallbackPtr = &dstCallback; -#endif - - //get all files and folders from directoryPostfixed (and subdirectories) - traverseFolder(newKey.directoryName, followSymlinks, traverser, dstCallbackPtr); //exceptions may be thrown! - } - return bufferVal; + return FolderPairCfg(getFormattedDirectoryName(enhPair.leftDirectory), //ensure they end with FILE_NAME_SEPARATOR and replace macros + getFormattedDirectoryName(enhPair.rightDirectory), + normalizeFilters(mainCfg.globalFilter, enhPair.localFilter), + mainCfg.handleSymlinks, + enhPair.altSyncConfig.get() ? enhPair.altSyncConfig->syncConfiguration : mainCfg.syncConfiguration); + }); + return output; } - //------------------------------------------------------------------------------------------ namespace { -void foldersAreValidForComparison(const std::vector& folderPairsForm, ProcessCallback& procCallback) +void checkForIncompleteInput(const std::vector& folderPairsForm, ProcessCallback& procCallback) { bool nonEmptyPairFound = false; //check if user entered at least one folder pair bool partiallyFilledPairFound = false; - const std::wstring additionalInfo = _("You can ignore this error to consider the directory as empty."); - - for (std::vector::const_iterator i = folderPairsForm.begin(); i != folderPairsForm.end(); ++i) + std::for_each(folderPairsForm.begin(), folderPairsForm.end(), + [&](const FolderPairCfg& fpCfg) { - if (!i->leftDirectoryFmt.empty() || !i->rightDirectoryFmt.empty()) //may be partially filled though + if (!fpCfg.leftDirectoryFmt.empty() || !fpCfg.rightDirectoryFmt.empty()) //may be partially filled though nonEmptyPairFound = true; - if ((i->leftDirectoryFmt.empty() && !i->rightDirectoryFmt.empty()) || - (!i->leftDirectoryFmt.empty() && i->rightDirectoryFmt.empty())) + if ((fpCfg.leftDirectoryFmt.empty() && !fpCfg.rightDirectoryFmt.empty()) || + (!fpCfg.leftDirectoryFmt.empty() && fpCfg.rightDirectoryFmt.empty())) partiallyFilledPairFound = true; - - //check if folders exist - if (!i->leftDirectoryFmt.empty()) - while (!zen::dirExists(i->leftDirectoryFmt)) - { - std::wstring errorMessage = _("Directory does not exist:") + "\n" + "\"" + i->leftDirectoryFmt + "\""; - ProcessCallback::Response rv = procCallback.reportError(errorMessage + "\n\n" + additionalInfo + " " + zen::getLastErrorFormatted()); - - if (rv == ProcessCallback::IGNORE_ERROR) - break; - else if (rv == ProcessCallback::RETRY) - ; //continue with loop - else - throw std::logic_error("Programming Error: Unknown return value! (2)"); - } - - if (!i->rightDirectoryFmt.empty()) - while (!zen::dirExists(i->rightDirectoryFmt)) - { - std::wstring errorMessage = _("Directory does not exist:") + "\n" + "\"" + i->rightDirectoryFmt + "\""; - ProcessCallback::Response rv = procCallback.reportError(errorMessage + "\n\n" + additionalInfo + " " + zen::getLastErrorFormatted()); - if (rv == ProcessCallback::IGNORE_ERROR) - break; - else if (rv == ProcessCallback::RETRY) - ; //continue with loop - else - throw std::logic_error("Programming Error: Unknown return value! (3)"); - } - } + }); //check for empty entries if (!nonEmptyPairFound || partiallyFilledPairFound) { while (true) { + const std::wstring additionalInfo = _("You can ignore this error to consider the directory as empty."); const ProcessCallback::Response rv = procCallback.reportError(_("A directory input field is empty.") + " \n\n" + + "(" + additionalInfo + ")"); if (rv == ProcessCallback::IGNORE_ERROR) @@ -427,6 +84,29 @@ void foldersAreValidForComparison(const std::vector& folderPairsF } +void checkDirectoryExistence(const std::set& dirnames, ProcessCallback& procCallback) +{ + std::for_each(dirnames.begin(), dirnames.end(), + [&](const Zstring& dirname) + { + if (!dirname.empty()) + while (!dirExistsUpdating(dirname, procCallback)) + { + const std::wstring additionalInfo = _("You can ignore this error to consider the directory as empty."); + std::wstring errorMessage = _("Directory does not exist:") + "\n" + "\"" + dirname + "\""; + ProcessCallback::Response rv = procCallback.reportError(errorMessage + "\n\n" + additionalInfo /* + " " + getLastErrorFormatted()*/); + + if (rv == ProcessCallback::IGNORE_ERROR) + break; + else if (rv == ProcessCallback::RETRY) + ; //continue with loop + else + throw std::logic_error("Programming Error: Unknown return value! (2)"); + } + }); +} + + namespace { struct EqualDependentDirectory : public std::binary_function @@ -453,17 +133,17 @@ wxString checkFolderDependency(const std::vector& folderPairsForm dependentDirs.push_back(std::make_pair(toWx(i->leftDirectoryFmt), toWx(i->rightDirectoryFmt))); } - wxString warnignMsg; + wxString warningMsg; if (!dependentDirs.empty()) { - warnignMsg = _("Directories are dependent! Be careful when setting up synchronization rules:"); + warningMsg = _("Directories are dependent! Be careful when setting up synchronization rules:"); for (auto i = dependentDirs.begin(); i != dependentDirs.end(); ++i) - warnignMsg += wxString(L"\n\n") + + warningMsg += wxString(L"\n\n") + "\"" + i->first + "\"\n" + "\"" + i->second + "\""; } - return warnignMsg; + return warningMsg; } @@ -562,10 +242,7 @@ CompareProcess::CompareProcess(size_t fileTimeTol, fileTimeTolerance(fileTimeTol), m_warnings(warnings), procCallback(handler), - txtComparingContentOfFiles(toZ(_("Comparing content of files %x")).Replace(Zstr("%x"), Zstr("\n\"%x\""), false)) -{ - directoryBuffer.reset(new DirectoryBuffer(handler)); -} + txtComparingContentOfFiles(toZ(_("Comparing content of files %x")).Replace(Zstr("%x"), Zstr("\n\"%x\""), false)) {} CompareProcess::~CompareProcess() {} //std::auto_ptr does not work with forward declarations (Or we need a non-inline ~CompareProcess())! @@ -575,10 +252,11 @@ void CompareProcess::startCompareProcess(const std::vector& direc const CompareVariant cmpVar, FolderComparison& output) { -#ifdef NDEBUG - wxLogNull noWxLogs; //hide wxWidgets log messages in release build -#endif - + /* + #ifdef NDEBUG + wxLogNull noWxLogs; //hide wxWidgets log messages in release build + #endif + */ //PERF_START; @@ -587,8 +265,18 @@ void CompareProcess::startCompareProcess(const std::vector& direc //-------------------some basic checks:------------------------------------------ - //ensure that folders are valid - foldersAreValidForComparison(directoryPairs, procCallback); + checkForIncompleteInput(directoryPairs, procCallback); + + + std::set dirnames; + std::for_each(directoryPairs.begin(), directoryPairs.end(), + [&](const FolderPairCfg& fpCfg) + { + dirnames.insert(fpCfg.leftDirectoryFmt); + dirnames.insert(fpCfg.rightDirectoryFmt); + }); + + checkDirectoryExistence(dirnames, procCallback); { //check if folders have dependencies @@ -602,6 +290,58 @@ void CompareProcess::startCompareProcess(const std::vector& direc try { + //------------------- fill directory buffer --------------------------------------------------- + std::set keysToRead; + + std::for_each(directoryPairs.begin(), directoryPairs.end(), + [&](const FolderPairCfg& fpCfg) + { + keysToRead.insert(DirectoryKey(fpCfg.leftDirectoryFmt, fpCfg.filter.nameFilter, fpCfg.handleSymlinks)); + keysToRead.insert(DirectoryKey(fpCfg.rightDirectoryFmt, fpCfg.filter.nameFilter, fpCfg.handleSymlinks)); + }); + + class CbImpl : public FillBufferCallback + { + public: + CbImpl(ProcessCallback& pcb) : + procCallback_(pcb), + itemsReported(0) {} + + virtual void reportStatus(const std::wstring& statusMsg, int itemTotal) + { + procCallback_.updateProcessedData(itemTotal - itemsReported, 0); //processed data is communicated in subfunctions! + itemsReported = itemTotal; + + procCallback_.reportInfo(statusMsg); //may throw + //procCallback_.requestUiRefresh(); //already called by reportInfo() + } + + virtual HandleError reportError(const std::wstring& errorText) + { + switch (procCallback_.reportError(errorText)) + { + case ProcessCallback::IGNORE_ERROR: + return TRAV_ERROR_IGNORE; + + case ProcessCallback::RETRY: + return TRAV_ERROR_RETRY; + } + + assert(false); + return TRAV_ERROR_IGNORE; + } + + private: + ProcessCallback& procCallback_; + int itemsReported; + } cb(procCallback); + + fillBuffer(keysToRead, //in + directoryBuffer, //out + cb, + UI_UPDATE_INTERVAL / 4); //every ~25 ms + //------------------------------------------------------------------------------------------- + //prevent shutdown while (binary) comparison is in progress util::DisableStandby dummy2; (void)dummy2; @@ -662,7 +402,7 @@ void CompareProcess::startCompareProcess(const std::vector& direc //--------------------assemble conflict descriptions--------------------------- //check for very old dates or date2s in the future -wxString getConflictInvalidDate(const Zstring& fileNameFull, zen::Int64 utcTime) +wxString getConflictInvalidDate(const Zstring& fileNameFull, Int64 utcTime) { wxString msg = _("File %x has an invalid date!"); replace(msg, L"%x", wxString(L"\"") + fileNameFull + "\""); @@ -706,65 +446,65 @@ wxString getConflictSameDateDiffSize(const FileMapping& fileObj) //----------------------------------------------------------------------------- -void CompareProcess::categorizeSymlinkByTime(SymLinkMapping* linkObj) const +void CompareProcess::categorizeSymlinkByTime(SymLinkMapping& linkObj) const { const CmpFileTime timeCmp(fileTimeTolerance); //categorize symlinks that exist on both sides if ( //special handling: if symlinks have the same "content" they are seen as equal while other metadata is ignored #ifdef FFS_WIN //type of symbolic link is relevant for Windows only - linkObj->getLinkType() == linkObj->getLinkType() && + linkObj.getLinkType() == linkObj.getLinkType() && #endif - !linkObj->getTargetPath().empty() && - linkObj->getTargetPath() == linkObj->getTargetPath()) + !linkObj.getTargetPath().empty() && + linkObj.getTargetPath() == linkObj.getTargetPath()) { //symlinks have same "content" - if (linkObj->getShortName() == linkObj->getShortName() && - timeCmp.getResult(linkObj->getLastWriteTime(), - linkObj->getLastWriteTime()) == CmpFileTime::TIME_EQUAL) - linkObj->setCategory(); + if (linkObj.getShortName() == linkObj.getShortName() && + timeCmp.getResult(linkObj.getLastWriteTime(), + linkObj.getLastWriteTime()) == CmpFileTime::TIME_EQUAL) + linkObj.setCategory(); else - linkObj->setCategory(); + linkObj.setCategory(); return; } - switch (timeCmp.getResult(linkObj->getLastWriteTime(), - linkObj->getLastWriteTime())) + switch (timeCmp.getResult(linkObj.getLastWriteTime(), + linkObj.getLastWriteTime())) { case CmpFileTime::TIME_EQUAL: if ( #ifdef FFS_WIN //type of symbolic link is relevant for Windows only - linkObj->getLinkType() == linkObj->getLinkType() && + linkObj.getLinkType() == linkObj.getLinkType() && #endif - linkObj->getTargetPath() == linkObj->getTargetPath()) //may both be empty if following link failed + linkObj.getTargetPath() == linkObj.getTargetPath()) //may both be empty if following link failed { - if (linkObj->getShortName() == linkObj->getShortName()) - linkObj->setCategory(); + if (linkObj.getShortName() == linkObj.getShortName()) + linkObj.setCategory(); else - linkObj->setCategory(); + linkObj.setCategory(); } else { wxString conflictMsg = _("Conflict detected:") + "\n" + _("Symlinks %x have the same date but a different target!"); - replace(conflictMsg, L"%x", wxString(L"\"") + linkObj->getRelativeName() + "\""); - linkObj->setCategoryConflict(conflictMsg); + replace(conflictMsg, L"%x", wxString(L"\"") + linkObj.getRelativeName() + "\""); + linkObj.setCategoryConflict(conflictMsg); } break; case CmpFileTime::TIME_LEFT_NEWER: - linkObj->setCategory(); + linkObj.setCategory(); break; case CmpFileTime::TIME_RIGHT_NEWER: - linkObj->setCategory(); + linkObj.setCategory(); break; case CmpFileTime::TIME_LEFT_INVALID: - linkObj->setCategoryConflict(getConflictInvalidDate(linkObj->getFullName(), linkObj->getLastWriteTime())); + linkObj.setCategoryConflict(getConflictInvalidDate(linkObj.getFullName(), linkObj.getLastWriteTime())); break; case CmpFileTime::TIME_RIGHT_INVALID: - linkObj->setCategoryConflict(getConflictInvalidDate(linkObj->getFullName(), linkObj->getLastWriteTime())); + linkObj.setCategoryConflict(getConflictInvalidDate(linkObj.getFullName(), linkObj.getLastWriteTime())); break; } } @@ -788,7 +528,8 @@ void CompareProcess::compareByTimeSize(const std::vector& directo performComparison(*pair, output.back(), uncategorizedFiles, uncategorizedLinks); //finish symlink categorization - std::for_each(uncategorizedLinks.begin(), uncategorizedLinks.end(), boost::bind(&CompareProcess::categorizeSymlinkByTime, this, _1)); + std::for_each(uncategorizedLinks.begin(), uncategorizedLinks.end(), + [&](SymLinkMapping* linkMap) { this->categorizeSymlinkByTime(*linkMap); }); //categorize files that exist on both sides const CmpFileTime timeCmp(fileTimeTolerance); @@ -833,9 +574,9 @@ void CompareProcess::compareByTimeSize(const std::vector& directo } -zen::UInt64 getBytesToCompare(const std::vector& rowsToCompare) +UInt64 getBytesToCompare(const std::vector& rowsToCompare) { - zen::UInt64 dataTotal; + UInt64 dataTotal; for (std::vector::const_iterator j = rowsToCompare.begin(); j != rowsToCompare.end(); ++j) dataTotal += (*j)->getFileSize(); //left and right filesizes should be the same @@ -844,27 +585,27 @@ zen::UInt64 getBytesToCompare(const std::vector& rowsToCompare) } -void CompareProcess::categorizeSymlinkByContent(SymLinkMapping* linkObj) const +void CompareProcess::categorizeSymlinkByContent(SymLinkMapping& linkObj) const { //categorize symlinks that exist on both sides const CmpFileTime timeCmp(fileTimeTolerance); if ( #ifdef FFS_WIN //type of symbolic link is relevant for Windows only - linkObj->getLinkType() == linkObj->getLinkType() && + linkObj.getLinkType() == linkObj.getLinkType() && #endif - linkObj->getTargetPath() == linkObj->getTargetPath()) + linkObj.getTargetPath() == linkObj.getTargetPath()) { //symlinks have same "content" - if (linkObj->getShortName() == linkObj->getShortName() && - timeCmp.getResult(linkObj->getLastWriteTime(), - linkObj->getLastWriteTime()) == CmpFileTime::TIME_EQUAL) - linkObj->setCategory(); + if (linkObj.getShortName() == linkObj.getShortName() && + timeCmp.getResult(linkObj.getLastWriteTime(), + linkObj.getLastWriteTime()) == CmpFileTime::TIME_EQUAL) + linkObj.setCategory(); else - linkObj->setCategory(); + linkObj.setCategory(); } else - linkObj->setCategory(); + linkObj.setCategory(); } @@ -889,7 +630,8 @@ void CompareProcess::compareByContent(const std::vector& director performComparison(*pair, output.back(), compareCandidates, uncategorizedLinks); //finish symlink categorization - std::for_each(uncategorizedLinks.begin(), uncategorizedLinks.end(), boost::bind(&CompareProcess::categorizeSymlinkByContent, this, _1)); + std::for_each(uncategorizedLinks.begin(), uncategorizedLinks.end(), + [&](SymLinkMapping* linkMap) { this->categorizeSymlinkByContent(*linkMap); }); } //finish categorization... @@ -910,10 +652,10 @@ void CompareProcess::compareByContent(const std::vector& director const size_t objectsTotal = filesToCompareBytewise.size() * 2; - const zen::UInt64 bytesTotal = getBytesToCompare(filesToCompareBytewise); + const UInt64 bytesTotal = getBytesToCompare(filesToCompareBytewise); procCallback.initNewProcess(static_cast(objectsTotal), - to(bytesTotal), + to(bytesTotal), ProcessCallback::PROCESS_COMPARING_CONTENT); const CmpFileTime timeCmp(fileTimeTolerance); @@ -1147,16 +889,16 @@ void CompareProcess::performComparison(const FolderPairCfg& fpCfg, //PERF_START; - //scan directories - const DirBufferValue& bufValueLeft = directoryBuffer->getDirectoryDescription( - output.getBaseDir(), - fpCfg.filter.nameFilter, - fpCfg.handleSymlinks); + auto getDirValue = [&](const Zstring& dirnameFmt) -> const DirectoryValue& + { + auto iter = directoryBuffer.find(DirectoryKey(dirnameFmt, fpCfg.filter.nameFilter, fpCfg.handleSymlinks)); + if (iter == directoryBuffer.end()) + throw std::logic_error("Programming Error: directory buffer entry not found!"); + return iter->second; + }; - const DirBufferValue& bufValueRight = directoryBuffer->getDirectoryDescription( - output.getBaseDir(), - fpCfg.filter.nameFilter, - fpCfg.handleSymlinks); + const DirectoryValue& bufValueLeft = getDirValue(fpCfg.leftDirectoryFmt); + const DirectoryValue& bufValueRight = getDirValue(fpCfg.rightDirectoryFmt); procCallback.reportInfo(_("Generating file list...")); procCallback.forceUiRefresh(); //keep total number of scanned files up to date @@ -1181,10 +923,10 @@ void CompareProcess::performComparison(const FolderPairCfg& fpCfg, if (!failedReads.empty()) { Zstring filterFailedRead; - //exclude subfolders only + //exclude subfolders only std::for_each(failedReads.begin(), failedReads.end(), - [&](const Zstring& relDirPf) { filterFailedRead += relDirPf + Zstr("?*\n"); }); - //note: relDirPf is empty for base dir, otherwise postfixed! e.g. "subdir\" + [&](const Zstring& relDirPf) { filterFailedRead += relDirPf + Zstr("?*\n"); }); + //note: relDirPf is empty for base dir, otherwise postfixed! e.g. "subdir\" addHardFiltering(output, filterFailedRead); } diff --git a/comparison.h b/comparison.h index 444b3c3c..2d1eab75 100644 --- a/comparison.h +++ b/comparison.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef COMPARISON_H_INCLUDED #define COMPARISON_H_INCLUDED @@ -13,6 +13,7 @@ #include "structures.h" #include "shared/disable_standby.h" #include "library/norm_filter.h" +#include "library/parallel_scan.h" namespace zen @@ -51,24 +52,22 @@ public: void startCompareProcess(const std::vector& directoryPairs, const CompareVariant cmpVar, FolderComparison& output); -~CompareProcess(); + ~CompareProcess(); private: void compareByTimeSize(const std::vector& directoryPairsFormatted, FolderComparison& output); void compareByContent( const std::vector& directoryPairsFormatted, FolderComparison& output); //create comparison result table and fill category except for files existing on both sides: undefinedFiles and undefinedLinks are appended! - void categorizeSymlinkByTime(SymLinkMapping* linkObj) const; - void categorizeSymlinkByContent(SymLinkMapping* linkObj) const; + void categorizeSymlinkByTime(SymLinkMapping& linkObj) const; + void categorizeSymlinkByContent(SymLinkMapping& linkObj) const; void performComparison(const FolderPairCfg& fpCfg, BaseDirMapping& output, std::vector& undefinedFiles, std::vector& undefinedLinks); - //buffer accesses to the same directories; useful when multiple folder pairs are used - class DirectoryBuffer; - std::unique_ptr directoryBuffer; + std::map directoryBuffer; const size_t fileTimeTolerance; //max allowed file time deviation diff --git a/file_hierarchy.cpp b/file_hierarchy.cpp index 9e7d4d4e..c1aa97ae 100644 --- a/file_hierarchy.cpp +++ b/file_hierarchy.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "file_hierarchy.h" #include "shared/build_info.h" diff --git a/file_hierarchy.h b/file_hierarchy.h index 1b4f244b..673acebc 100644 --- a/file_hierarchy.h +++ b/file_hierarchy.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef FILEHIERARCHY_H_INCLUDED #define FILEHIERARCHY_H_INCLUDED @@ -51,9 +51,6 @@ struct FileDescriptor zen::Int64 lastWriteTimeRaw; //number of seconds since Jan. 1st 1970 UTC, same semantics like time_t (== signed long) zen::UInt64 fileSize; - - //#warning: what about memory consumption?? (assume large comparisons!!?) - //util::FileID fileIdentifier; //unique file identifier, optional: may be NULL! }; @@ -94,9 +91,9 @@ class FileSystemObject; //------------------------------------------------------------------ /* ERD: -DirContainer 1 -----> 0..n DirContainer -DirContainer 1 -----> 0..n FileDescriptor -DirContainer 1 -----> 0..n LinkDescriptor + DirContainer 1 -----> 0..n DirContainer + DirContainer 1 -----> 0..n FileDescriptor + DirContainer 1 -----> 0..n LinkDescriptor */ struct DirContainer @@ -145,7 +142,7 @@ SymLinkMapping FileMapping DirMapping BaseDirMapping class HierarchyObject { public: - typedef size_t ObjectID; + typedef long ObjectID; FileSystemObject* retrieveById(ObjectID id); //returns NULL if object is not found; logarithmic complexity const FileSystemObject* retrieveById(ObjectID id) const; // @@ -282,9 +279,9 @@ class FileSystemObject public: virtual void accept(FSObjectVisitor& visitor) const = 0; - const Zstring getParentRelativeName() const; //get name relative to base sync dir without FILE_NAME_SEPARATOR postfix - const Zstring getObjRelativeName() const; //same as getRelativeName() but also returns value if either side is empty - const Zstring& getObjShortName() const; //same as getShortName() but also returns value if either side is empty + const Zstring getParentRelativeName() const; //get name relative to base sync dir without FILE_NAME_SEPARATOR postfix + const Zstring& getObjShortName () const; //same as getShortName() but also returns value if either side is empty + const Zstring getObjRelativeName () const; //same as getRelativeName() but also returns value if either side is empty template bool isEmpty() const; template const Zstring& getShortName() const; template const Zstring getRelativeName() const; //get name relative to base sync dir without FILE_NAME_SEPARATOR prefix @@ -572,6 +569,7 @@ HierarchyObject::ObjectID FileSystemObject::getId() const inline HierarchyObject::ObjectID FileSystemObject::getUniqueId() { + //warning: potential MT issue in the future! static HierarchyObject::ObjectID id = 0; return ++id; } @@ -665,16 +663,14 @@ SyncOperation FileSystemObject::testSyncOperation(bool selected, SyncDirection p } -template <> -inline +template <> inline bool FileSystemObject::isEmpty() const { return shortNameLeft_.empty(); } -template <> -inline +template <> inline bool FileSystemObject::isEmpty() const { return shortNameRight_.empty(); @@ -688,16 +684,14 @@ bool FileSystemObject::isEmpty() const } -template <> -inline +template <> inline const Zstring& FileSystemObject::getShortName() const { return shortNameLeft_; //empty if not existing } -template <> -inline +template <> inline const Zstring& FileSystemObject::getShortName() const { return shortNameRight_; //empty if not existing diff --git a/library/binary.cpp b/library/binary.cpp index 3a202711..1fd8c55f 100644 --- a/library/binary.cpp +++ b/library/binary.cpp @@ -3,12 +3,13 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "binary.h" #include "../shared/file_io.h" #include #include #include "../shared/int64.h" +#include inline void setMinSize(std::vector& buffer, size_t minSize) @@ -71,11 +72,15 @@ bool zen::filesHaveSameContent(const Zstring& filename1, const Zstring& filename FileInput file1(filename1); //throw (FileError) FileInput file2(filename2); //throw (FileError) - BufferSize bufferSize; + static boost::thread_specific_ptr> cpyBuf1; + static boost::thread_specific_ptr> cpyBuf2; + if (!cpyBuf1.get()) cpyBuf1.reset(new std::vector()); + if (!cpyBuf2.get()) cpyBuf2.reset(new std::vector()); - static std::vector memory1; - static std::vector memory2; + std::vector& memory1 = *cpyBuf1; + std::vector& memory2 = *cpyBuf2; + BufferSize bufferSize; zen::UInt64 bytesCompared; wxLongLong lastDelayViolation = wxGetLocalTimeMillis(); diff --git a/library/binary.h b/library/binary.h index b796ddbb..4dbbcd45 100644 --- a/library/binary.h +++ b/library/binary.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef BINARY_H_INCLUDED #define BINARY_H_INCLUDED diff --git a/library/custom_grid.cpp b/library/custom_grid.cpp index 97b608fb..ccabbea9 100644 --- a/library/custom_grid.cpp +++ b/library/custom_grid.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "custom_grid.h" #include "resources.h" #include diff --git a/library/custom_grid.h b/library/custom_grid.h index 8b70c417..6b577011 100644 --- a/library/custom_grid.h +++ b/library/custom_grid.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef CUSTOMGRID_H_INCLUDED #define CUSTOMGRID_H_INCLUDED diff --git a/library/db_file.cpp b/library/db_file.cpp index ec1c4464..9429dd1e 100644 --- a/library/db_file.cpp +++ b/library/db_file.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "db_file.h" #include #include @@ -305,7 +305,7 @@ std::pair zen::loadFromDisk(const BaseDirMapping& baseMa !streamLeft ->second.get() || !streamRight->second.get()) throw FileErrorDatabaseNotExisting(_("Initial synchronization:") + " \n\n" + - _("No matching synchronization session found in database files:") + " \n" + + _("Database files do not share a common synchronization session:") + " \n" + "\"" + fileNameLeft + "\"\n" + "\"" + fileNameRight + "\""); //read streams into DirInfo @@ -342,29 +342,27 @@ private: writeNumberC(false); //mark last entry } - void processFile(const FileMapping& fileMap, const DirContainer* oldDirInfo) + void processFile(const FileMapping& fileMap, const DirContainer* oldParentDir) { - const Zstring shortName = fileMap.getObjShortName(); - if (fileMap.getCategory() == FILE_EQUAL) //data in sync: write current state { if (!fileMap.isEmpty()) { writeNumberC(true); //mark beginning of entry - writeStringC(shortName); + writeStringC(fileMap.getShortName()); //save respecting case! (Windows) writeNumberC(to(fileMap.getLastWriteTime())); //last modification time writeNumberC(to(fileMap.getFileSize())); //filesize } } else //not in sync: reuse last synchronous state { - if (oldDirInfo) //no data is also a "synchronous state"! + if (oldParentDir) //no data is also a "synchronous state"! { - DirContainer::FileList::const_iterator iter = oldDirInfo->files.find(shortName); - if (iter != oldDirInfo->files.end()) + auto iter = oldParentDir->files.find(fileMap.getObjShortName()); + if (iter != oldParentDir->files.end()) { writeNumberC(true); //mark beginning of entry - writeStringC(shortName); + writeStringC(iter->first); //save respecting case! (Windows) writeNumberC(to(iter->second.lastWriteTimeRaw)); //last modification time writeNumberC(to(iter->second.fileSize)); //filesize } @@ -372,16 +370,14 @@ private: } } - void processLink(const SymLinkMapping& linkObj, const DirContainer* oldDirInfo) + void processLink(const SymLinkMapping& linkObj, const DirContainer* oldParentDir) { - const Zstring shortName = linkObj.getObjShortName(); - - if (linkObj.getCategory() == FILE_EQUAL) //data in sync: write current state + if (linkObj.getLinkCategory() == SYMLINK_EQUAL) //data in sync: write current state { if (!linkObj.isEmpty()) { writeNumberC(true); //mark beginning of entry - writeStringC(shortName); + writeStringC(linkObj.getShortName()); //save respecting case! (Windows) writeNumberC(to(linkObj.getLastWriteTime())); //last modification time writeStringC(linkObj.getTargetPath()); writeNumberC(linkObj.getLinkType()); @@ -389,13 +385,13 @@ private: } else //not in sync: reuse last synchronous state { - if (oldDirInfo) //no data is also a "synchronous state"! + if (oldParentDir) //no data is also a "synchronous state"! { - DirContainer::LinkList::const_iterator iter = oldDirInfo->links.find(shortName); - if (iter != oldDirInfo->links.end()) + auto iter = oldParentDir->links.find(linkObj.getObjShortName()); + if (iter != oldParentDir->links.end()) { writeNumberC(true); //mark beginning of entry - writeStringC(shortName); + writeStringC(iter->first); //save respecting case! (Windows) writeNumberC(to(iter->second.lastWriteTimeRaw)); //last modification time writeStringC(iter->second.targetPath); writeNumberC(iter->second.type); @@ -404,35 +400,62 @@ private: } } - void processDir(const DirMapping& dirMap, const DirContainer* oldDirInfo) + void processDir(const DirMapping& dirMap, const DirContainer* oldParentDir) { - const Zstring shortName = dirMap.getObjShortName(); - - const DirContainer* subDirInfo = NULL; - if (oldDirInfo) //no data is also a "synchronous state"! + const DirContainer* oldDir = NULL; + const Zstring* oldDirName = NULL; + if (oldParentDir) //no data is also a "synchronous state"! { - DirContainer::DirList::const_iterator iter = oldDirInfo->dirs.find(shortName); - if (iter != oldDirInfo->dirs.end()) - subDirInfo = &iter->second; + auto iter = oldParentDir->dirs.find(dirMap.getObjShortName()); + if (iter != oldParentDir->dirs.end()) + { + oldDirName = &iter->first; + oldDir = &iter->second; + } } - if (dirMap.getCategory() == FILE_EQUAL) //data in sync: write current state + CompareDirResult cat = dirMap.getDirCategory(); + + if (cat == DIR_EQUAL) //data in sync: write current state { if (!dirMap.isEmpty()) { writeNumberC(true); //mark beginning of entry - writeStringC(shortName); - execute(dirMap, subDirInfo); //recurse + writeStringC(dirMap.getShortName()); //save respecting case! (Windows) + execute(dirMap, oldDir); //recurse } } else //not in sync: reuse last synchronous state { - if (subDirInfo) //no data is also a "synchronous state"! + if (oldDir) { - writeNumberC(true); //mark beginning of entry - writeStringC(shortName); + writeNumberC(true); //mark beginning of entry + writeStringC(*oldDirName); //save respecting case! (Windows) + execute(dirMap, oldDir); //recurse + return; + } + //no data is also a "synchronous state"! + + //else: not in sync AND no "last synchronous state" + //we cannot simply skip the whole directory, since sub-items might be in sync + //Example: directories on left and right differ in case while sub-files are equal + switch (cat) + { + case DIR_LEFT_SIDE_ONLY: //sub-items cannot be in sync + break; + case DIR_RIGHT_SIDE_ONLY: //sub-items cannot be in sync + break; + case DIR_EQUAL: + assert(false); + break; + case DIR_DIFFERENT_METADATA: + writeNumberC(true); + writeStringC(dirMap.getShortName()); + //ATTENTION: strictly this is a violation of the principle of reporting last synchronous state! + //however in this case this will result in "last sync unsuccessful" for this directory within algorithm, which is fine + execute(dirMap, oldDir); //recurse and save sub-items which are in sync + break; } - execute(dirMap, subDirInfo); //recurse } } }; diff --git a/library/db_file.h b/library/db_file.h index a68e6bcf..dc9eb141 100644 --- a/library/db_file.h +++ b/library/db_file.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef DBFILE_H_INCLUDED #define DBFILE_H_INCLUDED diff --git a/library/detect_renaming.cpp b/library/detect_renaming.cpp index 0e19451c..39e7eb4b 100644 --- a/library/detect_renaming.cpp +++ b/library/detect_renaming.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "detect_renaming.h" #include #include diff --git a/library/detect_renaming.h b/library/detect_renaming.h index 9f360f8e..e94927c0 100644 --- a/library/detect_renaming.h +++ b/library/detect_renaming.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef DETECTRENAMING_H_INCLUDED #define DETECTRENAMING_H_INCLUDED diff --git a/library/dir_exist_async.h b/library/dir_exist_async.h new file mode 100644 index 00000000..661c70d6 --- /dev/null +++ b/library/dir_exist_async.h @@ -0,0 +1,35 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** + +#ifndef DIR_EXIST_HEADER_08173281673432158067342132467183267 +#define DIR_EXIST_HEADER_08173281673432158067342132467183267 + +#include "../shared/check_exist.h" +#include "status_handler.h" +#include "../shared/file_error.h" +#include "../shared/i18n.h" + +//dir existence checking may hang for non-existent network drives => run asynchronously and update UI! +namespace +{ +using namespace zen; //restricted to unnamed namespace! + +bool dirExistsUpdating(const Zstring& dirname, ProcessCallback& procCallback) +{ + using namespace util; + + std::wstring statusText = _("Searching for directory %x..."); + replace(statusText, L"%x", std::wstring(L"\"") + dirname + L"\"", false); + procCallback.reportInfo(statusText); + + auto ft = dirExistsAsync(dirname); + while (!ft.timed_wait(boost::posix_time::milliseconds(UI_UPDATE_INTERVAL))) + procCallback.requestUiRefresh(); //may throw! + return ft.get(); +} +} + +#endif //DIR_EXIST_HEADER_08173281673432158067342132467183267 diff --git a/library/dir_lock.cpp b/library/dir_lock.cpp index 1775026b..6123449b 100644 --- a/library/dir_lock.cpp +++ b/library/dir_lock.cpp @@ -42,15 +42,13 @@ const size_t DETECT_EXITUS_INTERVAL = 30000; //assume abandoned lock; unit [ms] const char LOCK_FORMAT_DESCR[] = "FreeFileSync"; const int LOCK_FORMAT_VER = 1; //lock file format version - -typedef Zbase BasicString; //thread safe string class } //worker thread class LifeSigns { public: - LifeSigns(const BasicString& lockfilename) : //throw()!!! siehe SharedDirLock() + LifeSigns(const Zstring& lockfilename) : //throw()!!! siehe SharedDirLock() lockfilename_(lockfilename) {} //thread safety: make deep copy! void operator()() const //thread entry @@ -120,8 +118,7 @@ public: } private: - //make sure this instance is safely copyable! - const BasicString lockfilename_; //thread local! Not ref-counted! + const Zstring lockfilename_; //thread local! atomic ref-count => binary value-type semantics! }; @@ -494,7 +491,7 @@ public: while (!::tryLock(lockfilename)) //throw (FileError) ::waitOnDirLock(lockfilename, callback); // - threadObj = boost::thread(LifeSigns(lockfilename.c_str())); + threadObj = std::move(boost::thread(LifeSigns(lockfilename))); } ~SharedDirLock() diff --git a/library/error_log.cpp b/library/error_log.cpp index eef8572a..28819f40 100644 --- a/library/error_log.cpp +++ b/library/error_log.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "error_log.h" #include #include "../shared/i18n.h" diff --git a/library/error_log.h b/library/error_log.h index 323a4297..f8a0c909 100644 --- a/library/error_log.h +++ b/library/error_log.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef ERRORLOGGING_H_INCLUDED #define ERRORLOGGING_H_INCLUDED diff --git a/library/hard_filter.cpp b/library/hard_filter.cpp index e96d32fa..c6d18f47 100644 --- a/library/hard_filter.cpp +++ b/library/hard_filter.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "hard_filter.h" #include "../shared/zstring.h" #include diff --git a/library/hard_filter.h b/library/hard_filter.h index 0711175a..bb0b6d54 100644 --- a/library/hard_filter.h +++ b/library/hard_filter.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef FFS_FILTER_H_INCLUDED #define FFS_FILTER_H_INCLUDED diff --git a/library/icon_buffer.cpp b/library/icon_buffer.cpp index 91487498..5d4dd19b 100644 --- a/library/icon_buffer.cpp +++ b/library/icon_buffer.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "icon_buffer.h" #include #include @@ -13,6 +13,8 @@ #include #include "../shared/i18n.h" #include "../shared/boost_thread_wrap.h" //include +#include "../shared/loki/ScopeGuard.h" +#include #ifdef FFS_WIN #include //includes "windows.h" @@ -28,38 +30,39 @@ using namespace zen; const size_t BUFFER_SIZE_MAX = 800; //maximum number of icons to buffer -//--------------------------------------------------------------------------------------------------- -typedef Zbase BasicString; //thread safe string class -//avoid reference-counted objects for shared data: NOT THREADSAFE!!! (implicitly shared variable: ref-count) -//--------------------------------------------------------------------------------------------------- - #ifdef FFS_WIN -BasicString getFileExtension(const BasicString& filename) +Zstring getFileExtension(const Zstring& filename) { - const BasicString shortName = filename.AfterLast(Zchar('\\')); //warning: using windows file name separator! + const Zstring shortName = afterLast(filename, Zchar('\\')); //warning: using windows file name separator! - return shortName.find(Zchar('.')) != BasicString::npos ? + return shortName.find(Zchar('.')) != Zstring::npos ? filename.AfterLast(Zchar('.')) : - BasicString(); + Zstring(); } +namespace +{ +std::set exceptions; //thread-safe! +boost::once_flag once = BOOST_ONCE_INIT; // +} + //test for extension for icons that physically have to be retrieved from disc -bool isPriceyExtension(const BasicString& extension) +bool isPriceyExtension(const Zstring& extension) { - static std::set exceptions; //not thread-safe, but called from worker thread only! - if (exceptions.empty()) + boost::call_once(once, []() { - exceptions.insert(Zstr("exe")); - exceptions.insert(Zstr("lnk")); - exceptions.insert(Zstr("ico")); - exceptions.insert(Zstr("ani")); - exceptions.insert(Zstr("cur")); - exceptions.insert(Zstr("url")); - exceptions.insert(Zstr("msc")); - exceptions.insert(Zstr("scr")); - } + exceptions.insert(L"exe"); + exceptions.insert(L"lnk"); + exceptions.insert(L"ico"); + exceptions.insert(L"ani"); + exceptions.insert(L"cur"); + exceptions.insert(L"url"); + exceptions.insert(L"msc"); + exceptions.insert(L"scr"); + }); + return exceptions.find(extension) != exceptions.end(); } #endif @@ -82,7 +85,7 @@ public: #ifdef FFS_WIN ::CopyIcon(other.handle_) #elif defined FFS_LINUX - gdk_pixbuf_copy(other.handle_) //create new Pix buf with reference count 1 or return 0 on error + ::gdk_pixbuf_copy(other.handle_) //create new Pix buf with reference count 1 or return 0 on error #endif ) {} @@ -98,14 +101,11 @@ public: #ifdef FFS_WIN ::DestroyIcon(handle_); #elif defined FFS_LINUX - g_object_unref(handle_); + ::g_object_unref(handle_); #endif } - void swap(IconHolder& other) //throw() - { - std::swap(handle_, other.handle_); - } + void swap(IconHolder& other) { std::swap(handle_, other.handle_); } //throw() wxIcon toWxIcon() const //copy HandleType, caller needs to take ownership! { @@ -130,7 +130,7 @@ private: }; -IconHolder getAssociatedIcon(const BasicString& filename) +IconHolder getAssociatedIcon(const Zstring& filename) { #ifdef FFS_WIN //despite what docu says about SHGetFileInfo() it can't handle all relative filenames, e.g. "\DirName" @@ -195,7 +195,7 @@ IconHolder getAssociatedIcon(const BasicString& filename) } #ifdef FFS_WIN -IconHolder getAssociatedIconByExt(const BasicString& extension) +IconHolder getAssociatedIconByExt(const Zstring& extension) { SHFILEINFO fileInfo = {}; //initialize hIcon -> fix for weird error: SHGetFileInfo() might return successfully WITHOUT filling fileInfo.hIcon!! @@ -211,80 +211,69 @@ IconHolder getAssociatedIconByExt(const BasicString& extension) #endif -const wxIcon& getDirectoryIcon() +wxIcon getDirectoryIcon() { - static wxIcon folderIcon; +#ifdef FFS_WIN + wxIcon folderIcon; - static bool isInitalized = false; //not thread-safe, but called from GUI thread only! - if (!isInitalized) - { - isInitalized = true; + SHFILEINFO fileInfo = {}; //initialize hIcon -#ifdef FFS_WIN - SHFILEINFO fileInfo = {}; //initialize hIcon + //NOTE: CoInitializeEx()/CoUninitialize() needs to be called for THIS thread! + if (::SHGetFileInfo(Zstr("dummy"), //Windows Seven doesn't like this parameter to be an empty string + FILE_ATTRIBUTE_DIRECTORY, + &fileInfo, + sizeof(fileInfo), + SHGFI_ICON | SHGFI_SMALLICON | SHGFI_USEFILEATTRIBUTES) && - //NOTE: CoInitializeEx()/CoUninitialize() needs to be called for THIS thread! - if (::SHGetFileInfo(Zstr("dummy"), //Windows Seven doesn't like this parameter to be an empty string - FILE_ATTRIBUTE_DIRECTORY, - &fileInfo, - sizeof(fileInfo), - SHGFI_ICON | SHGFI_SMALLICON | SHGFI_USEFILEATTRIBUTES) && + fileInfo.hIcon != 0) //fix for weird error: SHGetFileInfo() might return successfully WITHOUT filling fileInfo.hIcon!! + { + folderIcon.SetHICON(fileInfo.hIcon); //transfer ownership! + folderIcon.SetSize(IconBuffer::ICON_SIZE, IconBuffer::ICON_SIZE); + } - fileInfo.hIcon != 0) //fix for weird error: SHGetFileInfo() might return successfully WITHOUT filling fileInfo.hIcon!! - { - folderIcon.SetHICON(fileInfo.hIcon); //transfer ownership! - folderIcon.SetSize(IconBuffer::ICON_SIZE, IconBuffer::ICON_SIZE); - } + return folderIcon; #elif defined FFS_LINUX - folderIcon = ::getAssociatedIcon(Zstr("/usr/")).toWxIcon(); //all directories will look like "/usr/" + return ::getAssociatedIcon(Zstr("/usr/")).toWxIcon(); //all directories will look like "/usr/" #endif - } - return folderIcon; } -const wxIcon& getFileIcon() +wxIcon getFileIcon() { - static wxIcon fileIcon; - - static bool isInitalized = false; //not thread-safe, but called from GUI thread only! - if (!isInitalized) - { - isInitalized = true; + wxIcon fileIcon; #ifdef FFS_WIN - SHFILEINFO fileInfo = {}; //initialize hIcon + SHFILEINFO fileInfo = {}; //initialize hIcon - //NOTE: CoInitializeEx()/CoUninitialize() needs to be called for THIS thread! - if (::SHGetFileInfo(Zstr("dummy"), //Windows Seven doesn't like this parameter to be an empty string - FILE_ATTRIBUTE_NORMAL, - &fileInfo, - sizeof(fileInfo), - SHGFI_ICON | SHGFI_SMALLICON | SHGFI_USEFILEATTRIBUTES) && + //NOTE: CoInitializeEx()/CoUninitialize() needs to be called for THIS thread! + if (::SHGetFileInfo(Zstr("dummy"), //Windows Seven doesn't like this parameter to be an empty string + FILE_ATTRIBUTE_NORMAL, + &fileInfo, + sizeof(fileInfo), + SHGFI_ICON | SHGFI_SMALLICON | SHGFI_USEFILEATTRIBUTES) && - fileInfo.hIcon != 0) //fix for weird error: SHGetFileInfo() might return successfully WITHOUT filling fileInfo.hIcon!! - { - fileIcon.SetHICON(fileInfo.hIcon); //transfer ownership! - fileIcon.SetSize(IconBuffer::ICON_SIZE, IconBuffer::ICON_SIZE); - } + fileInfo.hIcon != 0) //fix for weird error: SHGetFileInfo() might return successfully WITHOUT filling fileInfo.hIcon!! + { + fileIcon.SetHICON(fileInfo.hIcon); //transfer ownership! + fileIcon.SetSize(IconBuffer::ICON_SIZE, IconBuffer::ICON_SIZE); + } #elif defined FFS_LINUX - try + try + { + Glib::RefPtr iconTheme = Gtk::IconTheme::get_default(); + if (iconTheme) { - Glib::RefPtr iconTheme = Gtk::IconTheme::get_default(); - if (iconTheme) - { - Glib::RefPtr iconPixbuf = iconTheme->load_icon("misc", IconBuffer::ICON_SIZE, Gtk::ICON_LOOKUP_USE_BUILTIN); - if (!iconPixbuf) - iconPixbuf = iconTheme->load_icon("text-x-generic", IconBuffer::ICON_SIZE, Gtk::ICON_LOOKUP_USE_BUILTIN); - if (iconPixbuf) - fileIcon.SetPixbuf(iconPixbuf->gobj_copy()); // transfer ownership!! - } + Glib::RefPtr iconPixbuf = iconTheme->load_icon("misc", IconBuffer::ICON_SIZE, Gtk::ICON_LOOKUP_USE_BUILTIN); + if (!iconPixbuf) + iconPixbuf = iconTheme->load_icon("text-x-generic", IconBuffer::ICON_SIZE, Gtk::ICON_LOOKUP_USE_BUILTIN); + if (iconPixbuf) + fileIcon.SetPixbuf(iconPixbuf->gobj_copy()); // transfer ownership!! } - catch (const Glib::Error&) {} -#endif } + catch (const Glib::Error&) {} +#endif return fileIcon; } @@ -293,37 +282,66 @@ const wxIcon& getFileIcon() //---------------------- Shared Data ------------------------- struct WorkLoad { - std::vector filesToLoad; //processes last elements of vector first! - boost::mutex mutex; - boost::condition_variable condition; //signal event: data for processing available +public: + Zstring extractNextFile() //context of worker thread, blocking + { + boost::unique_lock dummy(lockFiles); + + while (filesToLoad.empty()) + conditionNewFiles.timed_wait(dummy, boost::get_system_time() + boost::posix_time::milliseconds(50)); //interruption point! + + Zstring fileName = filesToLoad.back(); + filesToLoad.pop_back(); + return fileName; + } + + void setWorkload(const std::vector& newLoad) //context of main thread + { + boost::unique_lock dummy(lockFiles); + filesToLoad = newLoad; + + conditionNewFiles.notify_one(); + //condition handling, see: http://www.boost.org/doc/libs/1_43_0/doc/html/thread/synchronization.html#thread.synchronization.condvar_ref + } + +private: + std::vector filesToLoad; //processes last elements of vector first! + boost::mutex lockFiles; + boost::condition_variable conditionNewFiles; //signal event: data for processing available }; -typedef std::map NameIconMap; //entryName/icon -> ATTENTION: avoid ref-counting for this shared data structure! -typedef std::queue IconDbSequence; //entryName -struct Buffer +typedef std::map NameIconMap; //entryName/icon -> note: Zstring is thread-safe +typedef std::queue IconDbSequence; //entryName + +class Buffer { - boost::mutex lockAccess; - NameIconMap iconMappping; //use synchronisation when accessing this! +public: + bool requestFileIcon(const Zstring& fileName, wxIcon* icon = NULL); + void insertIntoBuffer(const Zstring& entryName, const IconHolder& icon); //called by worker thread + +private: + boost::mutex lockBuffer; + NameIconMap iconMappping; //use synchronisation when accessing this! IconDbSequence iconSequence; //save sequence of buffer entry to delete oldest elements }; //------------------------------------------------------------ -bool requestFileIcon(Buffer& buf, const Zstring& fileName, wxIcon* icon = NULL) +bool Buffer::requestFileIcon(const Zstring& fileName, wxIcon* icon) //context of main AND worker thread { - boost::lock_guard dummy(buf.lockAccess); + boost::lock_guard dummy(lockBuffer); #ifdef FFS_WIN //"pricey" extensions are stored with fullnames and are read from disk, while cheap ones require just the extension - const BasicString extension = getFileExtension(BasicString(fileName)); - const BasicString searchString = isPriceyExtension(extension) ? BasicString(fileName) : extension; - auto iter = buf.iconMappping.find(searchString); + const Zstring extension = getFileExtension(fileName); + const Zstring searchString = isPriceyExtension(extension) ? fileName : extension; + auto iter = iconMappping.find(searchString); #elif defined FFS_LINUX - auto iter = buf.iconMappping.find(BasicString(fileName)); + auto iter = iconMappping.find(fileName); #endif - if (iter == buf.iconMappping.end()) + if (iter == iconMappping.end()) return false; if (icon != NULL) @@ -332,23 +350,23 @@ bool requestFileIcon(Buffer& buf, const Zstring& fileName, wxIcon* icon = NULL) } -void insertIntoBuffer(Buffer& buf, const BasicString& entryName, const IconHolder& icon) //called by worker thread +void Buffer::insertIntoBuffer(const Zstring& entryName, const IconHolder& icon) //called by worker thread { - boost::lock_guard dummy(buf.lockAccess); + boost::lock_guard dummy(lockBuffer); //thread saftey: icon uses ref-counting! But is NOT shared with main thread! - auto rc = buf.iconMappping.insert(std::make_pair(entryName, icon)); + auto rc = iconMappping.insert(std::make_pair(entryName, icon)); if (rc.second) //if insertion took place - buf.iconSequence.push(entryName); //note: sharing Zstring with IconDB!!! + iconSequence.push(entryName); //note: sharing Zstring with IconDB!!! - assert(buf.iconMappping.size() == buf.iconSequence.size()); + assert(iconMappping.size() == iconSequence.size()); //remove elements if buffer becomes too big: - if (buf.iconMappping.size() > BUFFER_SIZE_MAX) //limit buffer size: critical because GDI resources are limited (e.g. 10000 on XP per process) + if (iconMappping.size() > BUFFER_SIZE_MAX) //limit buffer size: critical because GDI resources are limited (e.g. 10000 on XP per process) { //remove oldest element - buf.iconMappping.erase(buf.iconSequence.front()); - buf.iconSequence.pop(); + iconMappping.erase(iconSequence.front()); + iconSequence.pop(); } } //################################################################################################################################################ @@ -364,10 +382,8 @@ public: void operator()(); //thread entry private: - void doWork(); - - std::shared_ptr workload_; - std::shared_ptr buffer_; + std::shared_ptr workload_; //main/worker thread may access different shared_ptr instances safely (even though they have the same target!) + std::shared_ptr buffer_; //http://www.boost.org/doc/libs/1_43_0/libs/smart_ptr/shared_ptr.htm?sess=8153b05b34d890e02d48730db1ff7ddc#ThreadSafety }; @@ -375,79 +391,34 @@ void WorkerThread::operator()() //thread entry { //failure to initialize COM for each thread is a source of hard to reproduce bugs: https://sourceforge.net/tracker/?func=detail&aid=3160472&group_id=234430&atid=1093080 #ifdef FFS_WIN - struct ThreadInitializer - { - ThreadInitializer () { ::CoInitializeEx(NULL, COINIT_MULTITHREADED); } - ~ThreadInitializer() { ::CoUninitialize(); } - } dummy1; + ::CoInitializeEx(NULL, COINIT_MULTITHREADED | COINIT_DISABLE_OLE1DDE); + Loki::ScopeGuard dummy = Loki::MakeGuard([]() { ::CoUninitialize(); }); + (void)dummy; #endif - try - { - while (true) - { - { - boost::unique_lock dummy(workload_->mutex); - while(workload_->filesToLoad.empty()) - workload_->condition.wait(dummy); //interruption point! - //shared.condition.timed_wait(dummy, boost::get_system_time() + boost::posix_time::milliseconds(100)); - } - - doWork(); //no need to lock the complete method! - } - } - catch (boost::thread_interrupted&) - { - throw; //this is the only reasonable exception! - } - catch (const std::exception& e) //exceptions must be catched per thread - { - wxSafeShowMessage(wxString(_("An exception occurred!")) + wxT("(Icon buffer)"), wxString::FromAscii(e.what())); //simple wxMessageBox won't do for threads - } - catch (...) //exceptions must be catched per thread - { - wxSafeShowMessage(wxString(_("An exception occurred!")) + wxT("(Icon buffer2)"), wxT("Unknown exception in icon thread!")); //simple wxMessageBox won't do for threads - } -} - - -void WorkerThread::doWork() -{ - //do work: get the file icon. while (true) { - BasicString fileName; - { - boost::lock_guard dummy(workload_->mutex); - if (workload_->filesToLoad.empty()) - break; //enter waiting state - fileName = workload_->filesToLoad.back(); //deep copy - workload_->filesToLoad.pop_back(); - } + boost::this_thread::interruption_point(); - if (requestFileIcon(*buffer_, Zstring(fileName))) //thread safety: Zstring okay, won't be reference-counted in requestIcon() + const Zstring fileName = workload_->extractNextFile(); //start work: get next icon to load + + if (buffer_->requestFileIcon(fileName)) continue; //icon already in buffer: skip #ifdef FFS_WIN - const BasicString extension = getFileExtension(fileName); //thread-safe: no sharing! + const Zstring extension = getFileExtension(fileName); if (isPriceyExtension(extension)) //"pricey" extensions are stored with fullnames and are read from disk, while cheap ones require just the extension - { - const IconHolder newIcon = getAssociatedIcon(fileName); - insertIntoBuffer(*buffer_, fileName, newIcon); - } + buffer_->insertIntoBuffer(fileName, getAssociatedIcon(fileName)); else //no read-access to disk! determine icon by extension - { - const IconHolder newIcon = getAssociatedIconByExt(extension); - insertIntoBuffer(*buffer_, extension, newIcon); - } + buffer_->insertIntoBuffer(extension, getAssociatedIconByExt(extension)); + #elif defined FFS_LINUX const IconHolder newIcon = getAssociatedIcon(fileName); - insertIntoBuffer(*buffer_, fileName, newIcon); + buffer_->insertIntoBuffer(fileName, newIcon); #endif } } - //######################### redirect to impl ##################################################### struct IconBuffer::Pimpl @@ -456,7 +427,6 @@ struct IconBuffer::Pimpl workload(std::make_shared()), buffer(std::make_shared()) {} - std::shared_ptr workload; std::shared_ptr buffer; @@ -477,9 +447,6 @@ IconBuffer::~IconBuffer() pimpl->worker.join(); } -const wxIcon& IconBuffer::getDirectoryIcon() { return ::getDirectoryIcon(); } - -const wxIcon& IconBuffer::getFileIcon() { return ::getFileIcon(); } IconBuffer& IconBuffer::getInstance() { @@ -487,19 +454,18 @@ IconBuffer& IconBuffer::getInstance() return instance; } -bool IconBuffer::requestFileIcon(const Zstring& fileName, wxIcon* icon) { return ::requestFileIcon(*pimpl->buffer, fileName, icon); } - -void IconBuffer::setWorkload(const std::vector& load) -{ - { - boost::lock_guard dummy(pimpl->workload->mutex); +bool IconBuffer::requestFileIcon(const Zstring& fileName, wxIcon* icon) { return pimpl->buffer->requestFileIcon(fileName, icon); } - pimpl->workload->filesToLoad.clear(); +void IconBuffer::setWorkload(const std::vector& load) { pimpl->workload->setWorkload(load); } - std::transform(load.begin(), load.end(), std::back_inserter(pimpl->workload->filesToLoad), - [](const Zstring& file) { return BasicString(file); }); //make DEEP COPY from Zstring - } +const wxIcon& IconBuffer::getDirectoryIcon() +{ + static wxIcon dirIcon = ::getDirectoryIcon(); + return dirIcon; +} - pimpl->workload->condition.notify_one(); - //condition handling, see: http://www.boost.org/doc/libs/1_43_0/doc/html/thread/synchronization.html#thread.synchronization.condvar_ref +const wxIcon& IconBuffer::getFileIcon() +{ + static wxIcon fileIcon = ::getFileIcon(); + return fileIcon; } diff --git a/library/icon_buffer.h b/library/icon_buffer.h index 87f0cd4a..00370d1b 100644 --- a/library/icon_buffer.h +++ b/library/icon_buffer.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef ICONBUFFER_H_INCLUDED #define ICONBUFFER_H_INCLUDED diff --git a/library/lock_holder.h b/library/lock_holder.h index dc88ce71..172209dc 100644 --- a/library/lock_holder.h +++ b/library/lock_holder.h @@ -5,6 +5,7 @@ #include "../shared/zstring.h" #include "dir_lock.h" #include "status_handler.h" +#include "dir_exist_async.h" namespace zen { @@ -16,7 +17,10 @@ class LockHolder public: void addDir(const Zstring& dirnameFmt, ProcessCallback& procCallback) //resolved dirname ending with path separator { - if (dirnameFmt.empty()) return; + if (dirnameFmt.empty() || + !dirExistsUpdating(dirnameFmt, procCallback)) + return; + if (lockHolder.find(dirnameFmt) != lockHolder.end()) return; assert(dirnameFmt.EndsWith(FILE_NAME_SEPARATOR)); //this is really the contract, formatting does other things as well, e.g. macro substitution @@ -37,7 +41,7 @@ public: catch (const FileError& e) { bool dummy = false; //this warning shall not be shown but logged only - procCallback.reportWarning(e.msg(), dummy); + procCallback.reportWarning(e.msg(), dummy); //may throw! } } diff --git a/library/norm_filter.h b/library/norm_filter.h index 2e55b43f..609c81db 100644 --- a/library/norm_filter.h +++ b/library/norm_filter.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef NORM_FILTER_H_INCLUDED #define NORM_FILTER_H_INCLUDED diff --git a/library/parallel_scan.cpp b/library/parallel_scan.cpp new file mode 100644 index 00000000..2f91763a --- /dev/null +++ b/library/parallel_scan.cpp @@ -0,0 +1,617 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** + +#include "parallel_scan.h" +#include +#include "db_file.h" +#include "lock_holder.h" +#include "../shared/i18n.h" +#include "../shared/file_traverser.h" +#include "../shared/file_error.h" +#include "../shared/string_conv.h" +#include "../shared/check_exist.h" +#include "../shared/boost_thread_wrap.h" //include +#include "loki/ScopeGuard.h" +//#include "../shared/file_id.h" + +/* +#ifdef FFS_WIN +#include //includes "windows.h" +#include "WinIoCtl.h" + +#elif defined FFS_LINUX +#endif +*/ +using namespace zen; + + +#ifndef BOOST_HAS_THREADS +#error just some paranoia check... +#endif + + +namespace +{ +/* +#ifdef FFS_WIN + +struct DiskInfo +{ + DiskInfo() : + driveType(DRIVE_UNKNOWN), + diskID(-1) {} + + UINT driveType; + int diskID; // -1 if id could not be determined, this one is filled if driveType == DRIVE_FIXED or DRIVE_REMOVABLE; +}; + +inline +bool operator<(const DiskInfo& lhs, const DiskInfo& rhs) +{ + if (lhs.driveType != rhs.driveType) + return lhs.driveType < rhs.driveType; + + if (lhs.diskID < 0 || rhs.diskID < 0) + return false; + //consider "same", reason: one volume may be uniquely associated with one disk, while the other volume is associated to the same disk AND another one! + //volume <-> disk is 0..N:1..N + + return lhs.diskID < rhs.diskID ; +} + + +DiskInfo retrieveDiskInfo(const Zstring& pathName) +{ + std::vector volName(std::max(pathName.size(), static_cast(10000))); + + DiskInfo output; + + //full pathName need not yet exist! + if (!::GetVolumePathName(pathName.c_str(), //__in LPCTSTR lpszFileName, + &volName[0], //__out LPTSTR lpszVolumePathName, + static_cast(volName.size()))) //__in DWORD cchBufferLength + return output; + + const Zstring rootPathName = &volName[0]; + + output.driveType = ::GetDriveType(rootPathName.c_str()); + + if (output.driveType == DRIVE_NO_ROOT_DIR) //these two should be the same error category + output.driveType = DRIVE_UNKNOWN; + + if (output.driveType != DRIVE_FIXED && output.driveType != DRIVE_REMOVABLE) + return output; //no reason to get disk ID + + //go and find disk id: + + //format into form: "\\.\C:" + Zstring volnameFmt = rootPathName; + if (endsWith(volnameFmt, FILE_NAME_SEPARATOR)) + volnameFmt.resize(volnameFmt.size() - 1); + volnameFmt = L"\\\\.\\" + volnameFmt; + + HANDLE hVolume = ::CreateFile(volnameFmt.c_str(), + 0, + FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, + OPEN_EXISTING, + 0, + NULL); + if (hVolume == INVALID_HANDLE_VALUE) + return output; + + Loki::ScopeGuard dummy = Loki::MakeGuard(::CloseHandle, hVolume); + (void)dummy; //silence warning "unused variable" + + std::vector buffer(sizeof(VOLUME_DISK_EXTENTS) + sizeof(DISK_EXTENT)); //reserve buffer for at most one disk! call below will then fail if volume spans multiple disks! + + DWORD bytesReturned = 0; + if (!::DeviceIoControl(hVolume, // handle to device + IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS, // dwIoControlCode + NULL, // lpInBuffer + 0, // nInBufferSize + &buffer[0], // output buffer + static_cast(buffer.size()), // size of output buffer + &bytesReturned, // number of bytes returned + NULL)) // OVERLAPPED structure + return output; + + const VOLUME_DISK_EXTENTS& volDisks = *reinterpret_cast(&buffer[0]); + + if (volDisks.NumberOfDiskExtents != 1) + return output; + + output.diskID = volDisks.Extents[0].DiskNumber; + + return output; +} + +#elif defined FFS_LINUX +#endif +*/ + +/* +PERF NOTE + +-------------------------------------------- +|Testcase: Reading from two different disks| +-------------------------------------------- +Windows 7: + 1st(unbuffered) |2nd (OS buffered) + ---------------------------------- +1 Thread: 57s | 8s +2 Threads: 39s | 7s + +-------------------------------------------------- +|Testcase: Reading two directories from same disk| +-------------------------------------------------- +Windows 7: Windows XP: + 1st(unbuffered) |2nd (OS buffered) 1st(unbuffered) |2nd (OS buffered) + ---------------------------------- ---------------------------------- +1 Thread: 41s | 13s 1 Thread: 45s | 13s +2 Threads: 42s | 11s 2 Threads: 38s | 8s + +=> Traversing does not take any advantage of file locality so that even multiple threads operating on the same disk impose no performance overhead. +*/ + + +std::vector> separateByDistinctDisk(const std::set& dirkeys) +{ + //see perf note: use one thread per dirkey: + typedef std::map> DiskKeyMapping; + DiskKeyMapping tmp; + int index = 0; + std::for_each(dirkeys.begin(), dirkeys.end(), + [&](const DirectoryKey& key) { tmp[++index].insert(key); }); + + /* + //use one thread per physical disk: + typedef std::map> DiskKeyMapping; + DiskKeyMapping tmp; + std::for_each(dirkeys.begin(), dirkeys.end(), + [&](const DirectoryKey& key) { tmp[retrieveDiskInfo(key.dirnameFull_)].insert(key); }); + */ + std::vector> buckets; + std::transform(tmp.begin(), tmp.end(), std::back_inserter(buckets), + [&](const DiskKeyMapping::value_type& diskToKey) { return diskToKey.second; }); + return buckets; +} + +//------------------------------------------------------------------------------------------ +typedef Zbase BasicWString; //thread safe string class for UI texts + + +class AsyncCallback +{ +public: + AsyncCallback() : + notifyingThreadID(-1), + textScanning(_("Scanning:")), + itemsScanned(0), + activeWorker(0) {} + + FillBufferCallback::HandleError reportError(const std::wstring& msg) //blocking call: context of worker thread + { + boost::unique_lock dummy(lockErrorMsg); + while(!errorMsg.empty() || errorResponse.get()) + conditionCanReportError.timed_wait(dummy, boost::posix_time::milliseconds(50)); //interruption point! + + errorMsg = BasicWString(msg); + + while(!errorResponse.get()) + conditionGotResponse.timed_wait(dummy, boost::posix_time::milliseconds(50)); //interruption point! + + FillBufferCallback::HandleError rv = *errorResponse; + + errorMsg.clear(); + errorResponse.reset(); + conditionCanReportError.notify_one(); + return rv; + } + + void processErrors(FillBufferCallback& callback) //context of main thread, call repreatedly + { + boost::lock_guard dummy(lockErrorMsg); + if (!errorMsg.empty() && !errorResponse.get()) + { + FillBufferCallback::HandleError rv = callback.reportError(cvrtString(errorMsg)); //throw! + errorResponse.reset(new FillBufferCallback::HandleError(rv)); + conditionGotResponse.notify_one(); + } + } + + void setNotifyingThread(int threadID) { notifyingThreadID = threadID; } //context of main thread + + void reportCurrentFile(const Zstring& filename, int threadID) //context of worker thread + { + if (threadID != notifyingThreadID) return; //only one thread may report status + + boost::lock_guard dummy(lockCurrentStatus); + currentFile = filename; + currentStatus.clear(); + } + + void reportCurrentStatus(const std::wstring& status, int threadID) //context of worker thread + { + if (threadID != notifyingThreadID) return; //only one thread may report status + + boost::lock_guard dummy(lockCurrentStatus); + currentFile.clear(); + currentStatus = BasicWString(status); //we cannot assume std::wstring to be thread safe (yet)! + } + + std::wstring getCurrentStatus() //context of main thread, call repreatedly + { + std::wstring filename; + std::wstring statusMsg; + { + boost::lock_guard dummy(lockCurrentStatus); + if (!currentFile.empty()) + filename = utf8CvrtTo(currentFile); + else if (!currentStatus.empty()) + statusMsg = cvrtString(currentStatus); + } + + if (!filename.empty()) + { + std::wstring statusText = cvrtString(textScanning); + const long activeCount = activeWorker; + if (activeCount >= 2) + { + statusText += L" " + _P("[1 Thread]", "[%x Threads]", activeCount); + replace(statusText, L"%x", toString(activeCount)); + } + statusText += std::wstring(L" \n") + L'\"' + filename + L'\"'; + return statusText; + } + else + return statusMsg; + } + + void incItemsScanned() { ++itemsScanned; } + long getItemsScanned() const { return itemsScanned; } + + void incActiveWorker() { ++activeWorker; } + void decActiveWorker() { --activeWorker; } + long getActiveWorker() const { return activeWorker; } + +private: + //---- error handling ---- + boost::mutex lockErrorMsg; + boost::condition_variable conditionCanReportError; + boost::condition_variable conditionGotResponse; + BasicWString errorMsg; + std::unique_ptr errorResponse; + + //---- status updates ---- + volatile int notifyingThreadID; //theoretically racy, but there is nothing that could go wrong... + //CAVEAT: do NOT use boost::thread::id as long as this showstopper exists: https://svn.boost.org/trac/boost/ticket/5754 + boost::mutex lockCurrentStatus; //use a different lock for current file: continue traversing while some thread may process an error + Zstring currentFile; //only one of these two is filled at a time! + BasicWString currentStatus; // + + const BasicWString textScanning; //this one is (currently) not shared and could be made a std::wstring, but we stay consistent and use thread-safe variables in this class only! + + //---- status updates II (lock free) ---- + boost::detail::atomic_count itemsScanned; + boost::detail::atomic_count activeWorker; +}; +//------------------------------------------------------------------------------------------------- + +class DirCallback; + +struct TraverserConfig +{ +public: + TraverserConfig(int threadID, + SymLinkHandling handleSymlinks, + const HardFilter::FilterRef& filter, + std::set& failedReads, + AsyncCallback& acb) : + handleSymlinks_(handleSymlinks), + filterInstance(filter), + failedReads_(failedReads), + acb_(acb), + threadID_(threadID) {} + + typedef std::shared_ptr CallbackPointer; + std::vector callBackBox; //collection of callback pointers to handle ownership + + const SymLinkHandling handleSymlinks_; + const HardFilter::FilterRef filterInstance; //always bound! + std::set& failedReads_; //relative postfixed names of directories that could not be read (empty for root) + + AsyncCallback& acb_; + int threadID_; +}; + + +class DirCallback : public zen::TraverseCallback +{ +public: + DirCallback(TraverserConfig& config, + const Zstring& relNameParentPf, //postfixed with FILE_NAME_SEPARATOR! + DirContainer& output) : + cfg(config), + relNameParentPf_(relNameParentPf), + output_(output) {} + + virtual void onFile (const Zchar* shortName, const Zstring& fullName, const FileInfo& details); + virtual void onSymlink(const Zchar* shortName, const Zstring& fullName, const SymlinkInfo& details); + virtual ReturnValDir onDir (const Zchar* shortName, const Zstring& fullName); + virtual HandleError onError (const std::wstring& errorText); + +private: + TraverserConfig& cfg; + const Zstring relNameParentPf_; + DirContainer& output_; +}; + + +void DirCallback::onFile(const Zchar* shortName, const Zstring& fullName, const FileInfo& details) +{ + boost::this_thread::interruption_point(); + + const Zstring fileNameShort = shortName; + + //do not list the database file(s) sync.ffs_db, sync.x64.ffs_db, etc. or lock files + if (endsWith(fileNameShort, SYNC_DB_FILE_ENDING) || + endsWith(fileNameShort, LOCK_FILE_ENDING)) + return; + + //update status information no matter whether object is excluded or not! + cfg.acb_.reportCurrentFile(fullName, cfg.threadID_); + + //------------------------------------------------------------------------------------ + //apply filter before processing (use relative name!) + if (!cfg.filterInstance->passFileFilter(relNameParentPf_ + fileNameShort)) + return; + + // std::string fileId = details.fileSize >= 1024 * 1024U ? + // util::retrieveFileID(fullName) : + // std::string(); + /* + Perf test Windows 7, SSD, 350k files, 50k dirs, files > 1MB: 7000 + regular: 6.9s + ID per file: 43.9s + ID per file > 1MB: 7.2s + ID per dir: 8.4s + + Linux: retrieveFileID takes about 50% longer in VM! (avoidable because of redundant stat() call!) + */ + + output_.addSubFile(fileNameShort, FileDescriptor(details.lastWriteTimeRaw, details.fileSize)); + + cfg.acb_.incItemsScanned(); //add 1 element to the progress indicator +} + + +void DirCallback::onSymlink(const Zchar* shortName, const Zstring& fullName, const SymlinkInfo& details) +{ + boost::this_thread::interruption_point(); + + if (cfg.handleSymlinks_ == SYMLINK_IGNORE) + return; + + //update status information no matter whether object is excluded or not! + cfg.acb_.reportCurrentFile(fullName, cfg.threadID_); + + //------------------------------------------------------------------------------------ + const Zstring& relName = relNameParentPf_ + shortName; + + //apply filter before processing (use relative name!) + if (!cfg.filterInstance->passFileFilter(relName)) //always use file filter: Link type may not be "stable" on Linux! + return; + + output_.addSubLink(shortName, LinkDescriptor(details.lastWriteTimeRaw, details.targetPath, details.dirLink ? LinkDescriptor::TYPE_DIR : LinkDescriptor::TYPE_FILE)); + + cfg.acb_.incItemsScanned(); //add 1 element to the progress indicator +} + + +TraverseCallback::ReturnValDir DirCallback::onDir(const Zchar* shortName, const Zstring& fullName) +{ + boost::this_thread::interruption_point(); + + //update status information no matter whether object is excluded or not! + cfg.acb_.reportCurrentFile(fullName, cfg.threadID_); + + //------------------------------------------------------------------------------------ + const Zstring& relName = relNameParentPf_ + shortName; + + //apply filter before processing (use relative name!) + bool subObjMightMatch = true; + if (!cfg.filterInstance->passDirFilter(relName, &subObjMightMatch)) + { + if (!subObjMightMatch) + return Loki::Int2Type(); //do NOT traverse subdirs + } + else + cfg.acb_.incItemsScanned(); //add 1 element to the progress indicator + + DirContainer& subDir = output_.addSubDir(shortName); + + TraverserConfig::CallbackPointer subDirCallback = std::make_shared(cfg, relName + FILE_NAME_SEPARATOR, subDir); + cfg.callBackBox.push_back(subDirCallback); //handle lifetime + //attention: ensure directory filtering is applied later to exclude actually filtered directories + return ReturnValDir(Loki::Int2Type(), *subDirCallback.get()); +} + + +DirCallback::HandleError DirCallback::onError(const std::wstring& errorText) +{ + switch (cfg.acb_.reportError(errorText)) + { + case FillBufferCallback::TRAV_ERROR_IGNORE: + cfg.failedReads_.insert(relNameParentPf_); + return TRAV_ERROR_IGNORE; + + case FillBufferCallback::TRAV_ERROR_RETRY: + return TRAV_ERROR_RETRY; + } + + assert(false); + return TRAV_ERROR_IGNORE; +} + + +#ifdef FFS_WIN +class DstHackCallbackImpl : public DstHackCallback +{ +public: + DstHackCallbackImpl(AsyncCallback& acb, int threadID) : + acb_(acb), + threadID_(threadID), + textApplyingDstHack(toZ(_("Encoding extended time information: %x")).Replace(Zstr("%x"), Zstr("\n\"%x\""))) {} + +private: + virtual void requestUiRefresh(const Zstring& filename) //applying DST hack imposes significant one-time performance drawback => callback to inform user + { + Zstring statusText = textApplyingDstHack; + replace(statusText, Zstr("%x"), filename); + acb_.reportCurrentStatus(utf8CvrtTo(statusText), threadID_); + } + + AsyncCallback& acb_; + int threadID_; + const Zstring textApplyingDstHack; +}; +#endif +//------------------------------------------------------------------------------------------ + + +class WorkerThread +{ +public: + WorkerThread(int threadID, + const std::shared_ptr& acb, + const std::vector>& workload) : + threadID_(threadID), + acb_(acb), + workload_(workload) {} + + void operator()() //thread entry + { + acb_->incActiveWorker(); + Loki::ScopeGuard dummy = Loki::MakeGuard([&]() { acb_->decActiveWorker(); }); + (void)dummy; + + std::for_each(workload_.begin(), workload_.end(), + [&](std::pair& item) + { + const Zstring& directoryName = item.first.dirnameFull_; + DirectoryValue& dirVal = *item.second; + + acb_->reportCurrentFile(directoryName, threadID_); //just in case directory existence check is blocking! + + if (!directoryName.empty() && + util::dirExistsAsync(directoryName).get()) //blocking + interruption point! + //folder existence already checked in startCompareProcess(): do not treat as error when arriving here! + //perf note: missing network drives should not delay here, as Windows buffers result of last existence check for a short time + { + TraverserConfig travCfg(threadID_, + item.first.handleSymlinks_, //shared by all(!) instances of DirCallback while traversing a folder hierarchy + item.first.filter_, + dirVal.failedReads, + *acb_); + + DirCallback traverser(travCfg, + Zstring(), + dirVal.dirCont); + + bool followSymlinks = false; + switch (item.first.handleSymlinks_) + { + case SYMLINK_IGNORE: + followSymlinks = false; //=> symlinks will be reported via onSymlink() where they are excluded + break; + case SYMLINK_USE_DIRECTLY: + followSymlinks = false; + break; + case SYMLINK_FOLLOW_LINK: + followSymlinks = true; + break; + } + + DstHackCallback* dstCallbackPtr = NULL; +#ifdef FFS_WIN + DstHackCallbackImpl dstCallback(*acb_, threadID_); + dstCallbackPtr = &dstCallback; +#endif + + //get all files and folders from directoryPostfixed (and subdirectories) + traverseFolder(directoryName, followSymlinks, traverser, dstCallbackPtr); //exceptions may be thrown! + } + }); + } + +private: + int threadID_; + std::shared_ptr acb_; + std::vector> workload_; +}; +} + + +void zen::fillBuffer(const std::set& keysToRead, //in + std::map& buf, //out + FillBufferCallback& callback, + size_t statusInterval) +{ + buf.clear(); + + std::vector> buckets = separateByDistinctDisk(keysToRead); //one bucket per physical device + + std::vector worker; //note: GCC doesn't allow to construct an array of empty threads since they would be initialized by const boost::thread& + worker.reserve(buckets.size()); + + Loki::ScopeGuard guardWorker = Loki::MakeGuard([&]() + { + std::for_each(worker.begin(), worker.end(), std::mem_fun_ref(&boost::thread::interrupt)); //interrupt all at once, then join + std::for_each(worker.begin(), worker.end(), std::mem_fun_ref(&boost::thread::join)); + }); + + std::shared_ptr acb = std::make_shared(); + + //init worker threads + for (auto iter = buckets.begin(); iter != buckets.end(); ++iter) + { + int threadID = iter - buckets.begin(); + const std::set& bucket = *iter; + + std::vector> workload; + std::for_each(bucket.begin(), bucket.end(), + [&](const DirectoryKey& key) + { + auto rv = buf.insert(std::make_pair(key, DirectoryValue())); + assert(rv.second); + workload.push_back(std::make_pair(key, &rv.first->second)); + }); + + worker.push_back(boost::thread(WorkerThread(threadID, acb, workload))); + } + + //wait until done + for (auto iter = worker.begin(); iter != worker.end(); ++iter) + { + boost::thread& wt = *iter; + int threadID = iter - worker.begin(); + + acb->setNotifyingThread(threadID); //process info messages of first (active) thread only + + do + { + //update status + callback.reportStatus(acb->getCurrentStatus(), acb->getItemsScanned()); //throw! + + //process errors + acb->processErrors(callback); + } + while (!wt.timed_join(boost::posix_time::milliseconds(statusInterval))); + } + + guardWorker.Dismiss(); +} diff --git a/library/parallel_scan.h b/library/parallel_scan.h new file mode 100644 index 00000000..f36c5ec7 --- /dev/null +++ b/library/parallel_scan.h @@ -0,0 +1,74 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** + +#ifndef PARALLEL_SCAN_H_INCLUDED +#define PARALLEL_SCAN_H_INCLUDED + +#include +#include +#include "hard_filter.h" +#include "../structures.h" +#include "../file_hierarchy.h" + +namespace zen +{ +struct DirectoryKey +{ + DirectoryKey(const Zstring& dirnameFull, + const HardFilter::FilterRef& filter, + SymLinkHandling handleSymlinks) : + dirnameFull_(dirnameFull), + filter_(filter), + handleSymlinks_(handleSymlinks) {} + + Zstring dirnameFull_; + HardFilter::FilterRef filter_; //filter interface: always bound by design! + SymLinkHandling handleSymlinks_; +}; + +inline +bool operator<(const DirectoryKey& lhs, const DirectoryKey& rhs) +{ + if (lhs.handleSymlinks_ != rhs.handleSymlinks_) + return lhs.handleSymlinks_ < rhs.handleSymlinks_; + + if (!EqualFilename()(lhs.dirnameFull_, rhs.dirnameFull_)) + return LessFilename()(lhs.dirnameFull_, rhs.dirnameFull_); + + return *lhs.filter_ < *rhs.filter_; +} + + +struct DirectoryValue +{ + DirContainer dirCont; + std::set failedReads; //relative postfixed names of directories that could not be read (empty for root), e.g. access denied, or temporal network drop +}; + + +class FillBufferCallback +{ +public: + virtual ~FillBufferCallback() {} + + enum HandleError + { + TRAV_ERROR_RETRY, + TRAV_ERROR_IGNORE + }; + virtual HandleError reportError (const std::wstring& errorText) = 0; //may throw! + virtual void reportStatus(const std::wstring& statusMsg, int itemTotal) = 0; // +}; + +//attention: ensure directory filtering is applied later to exclude filtered directories which have been erroneously kept + +void fillBuffer(const std::set& keysToRead, //in + std::map& buf, //out + FillBufferCallback& callback, + size_t statusInterval); //unit: [ms] +} + +#endif // PARALLEL_SCAN_H_INCLUDED diff --git a/library/process_xml.cpp b/library/process_xml.cpp index 69dad7f3..276bc977 100644 --- a/library/process_xml.cpp +++ b/library/process_xml.cpp @@ -3,9 +3,9 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "process_xml.h" -#include +#include #include "../shared/i18n.h" #include "../shared/global_func.h" #include "../shared/standard_paths.h" @@ -42,10 +42,10 @@ XmlType xmlAccess::getXmlType(const wxString& filename) //throw() XmlDoc doc; try { - std::string stream = loadStream(filename); //throw XmlFileError - parse(stream, doc); //throw XmlParsingError + //do NOT use zen::loadStream as it will superfluously load even huge files! + loadXmlDocument(filename, doc); //throw FfsXmlError, quick exit if file is not an FFS XML } - catch (const zen::XmlError&) //catch XmlFileError, XmlParsingError + catch (const FfsXmlError&) { return XML_TYPE_OTHER; } diff --git a/library/process_xml.h b/library/process_xml.h index d7437825..e8a11962 100644 --- a/library/process_xml.h +++ b/library/process_xml.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef PROCESSXML_H_INCLUDED #define PROCESSXML_H_INCLUDED diff --git a/library/resources.cpp b/library/resources.cpp index 179033a7..cbfd7c06 100644 --- a/library/resources.cpp +++ b/library/resources.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "resources.h" #include #include diff --git a/library/resources.h b/library/resources.h index 691d5a6b..f812ac90 100644 --- a/library/resources.h +++ b/library/resources.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef RESOURCES_H_INCLUDED #define RESOURCES_H_INCLUDED diff --git a/library/soft_filter.h b/library/soft_filter.h index 0a406907..bde812b0 100644 --- a/library/soft_filter.h +++ b/library/soft_filter.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef SOFT_FILTER_H_INCLUDED #define SOFT_FILTER_H_INCLUDED diff --git a/library/statistics.cpp b/library/statistics.cpp index 812c869b..a29f60af 100644 --- a/library/statistics.cpp +++ b/library/statistics.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "statistics.h" #include diff --git a/library/statistics.h b/library/statistics.h index a9692d77..0ec82c14 100644 --- a/library/statistics.h +++ b/library/statistics.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef STATISTICS_H_INCLUDED #define STATISTICS_H_INCLUDED diff --git a/library/status_handler.cpp b/library/status_handler.cpp index 0a131899..9c2fdd67 100644 --- a/library/status_handler.cpp +++ b/library/status_handler.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "status_handler.h" #include #include diff --git a/library/status_handler.h b/library/status_handler.h index a7984790..a295b6a0 100644 --- a/library/status_handler.h +++ b/library/status_handler.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef STATUSHANDLER_H_INCLUDED #define STATUSHANDLER_H_INCLUDED diff --git a/shared/IFileOperation/dll_main.cpp b/shared/IFileOperation/dll_main.cpp index ab387012..3805c99d 100644 --- a/shared/IFileOperation/dll_main.cpp +++ b/shared/IFileOperation/dll_main.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #define WIN32_LEAN_AND_MEAN #include diff --git a/shared/IFileOperation/file_op.cpp b/shared/IFileOperation/file_op.cpp index fc942f44..a2cf9413 100644 --- a/shared/IFileOperation/file_op.cpp +++ b/shared/IFileOperation/file_op.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "file_op.h" #include "../com_ptr.h" #include "../com_error.h" diff --git a/shared/IFileOperation/file_op.h b/shared/IFileOperation/file_op.h index 25098e45..c1bb26a2 100644 --- a/shared/IFileOperation/file_op.h +++ b/shared/IFileOperation/file_op.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef RECYCLER_DLL_H #define RECYCLER_DLL_H diff --git a/shared/ShadowCopy/LockFile.cpp b/shared/ShadowCopy/LockFile.cpp index 0761a3e3..7df3ec66 100644 --- a/shared/ShadowCopy/LockFile.cpp +++ b/shared/ShadowCopy/LockFile.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include #include diff --git a/shared/ShadowCopy/dll_main.cpp b/shared/ShadowCopy/dll_main.cpp index ab387012..3805c99d 100644 --- a/shared/ShadowCopy/dll_main.cpp +++ b/shared/ShadowCopy/dll_main.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #define WIN32_LEAN_AND_MEAN #include diff --git a/shared/ShadowCopy/shadow.cpp b/shared/ShadowCopy/shadow.cpp index d536470a..8b7b9971 100644 --- a/shared/ShadowCopy/shadow.cpp +++ b/shared/ShadowCopy/shadow.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "shadow.h" #include #include diff --git a/shared/ShadowCopy/shadow.h b/shared/ShadowCopy/shadow.h index a96d8578..b21395da 100644 --- a/shared/ShadowCopy/shadow.h +++ b/shared/ShadowCopy/shadow.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef SHADOWCOPY_H #define SHADOWCOPY_H diff --git a/shared/Taskbar_Seven/dll_main.cpp b/shared/Taskbar_Seven/dll_main.cpp index ab387012..3805c99d 100644 --- a/shared/Taskbar_Seven/dll_main.cpp +++ b/shared/Taskbar_Seven/dll_main.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #define WIN32_LEAN_AND_MEAN #include diff --git a/shared/Taskbar_Seven/taskbar.cpp b/shared/Taskbar_Seven/taskbar.cpp index 297a0739..bbbaaf7d 100644 --- a/shared/Taskbar_Seven/taskbar.cpp +++ b/shared/Taskbar_Seven/taskbar.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "taskbar.h" #define WIN32_LEAN_AND_MEAN diff --git a/shared/Taskbar_Seven/taskbar.h b/shared/Taskbar_Seven/taskbar.h index d52420ab..3bae28a9 100644 --- a/shared/Taskbar_Seven/taskbar.h +++ b/shared/Taskbar_Seven/taskbar.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef TASKBAR_SEVEN_DLL_H #define TASKBAR_SEVEN_DLL_H diff --git a/shared/app_main.cpp b/shared/app_main.cpp index b727724f..28ce1e09 100644 --- a/shared/app_main.cpp +++ b/shared/app_main.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "app_main.h" #include #include diff --git a/shared/app_main.h b/shared/app_main.h index 33ddcfb6..fa538771 100644 --- a/shared/app_main.h +++ b/shared/app_main.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef APPMAIN_H_INCLUDED #define APPMAIN_H_INCLUDED diff --git a/shared/build_info.h b/shared/build_info.h index c3be26bd..f13b2dbc 100644 --- a/shared/build_info.h +++ b/shared/build_info.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef BUILDINFO_H_INCLUDED #define BUILDINFO_H_INCLUDED diff --git a/shared/c_dll.h b/shared/c_dll.h index f913cde9..15597a9c 100644 --- a/shared/c_dll.h +++ b/shared/c_dll.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef C_DLL_HEADER #define C_DLL_HEADER diff --git a/shared/check_exist.cpp b/shared/check_exist.cpp deleted file mode 100644 index 6c6c0871..00000000 --- a/shared/check_exist.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** -// -#include "check_exist.h" -#include "file_handling.h" -#include -#include "boost_thread_wrap.h" //include - - -/* -#ifdef __MINGW32__ -//oh well, nothing is for free... -//https://svn.boost.org/trac/boost/ticket/4258 -extern "C" void tss_cleanup_implemented() {}; -#endif -*/ - -namespace -{ -typedef Zbase BasicString; //thread safe string class - -template -util::ResultExist checkExistence(const Zstring& objName, size_t timeout) //timeout in ms -{ - using namespace util; - - std::shared_ptr isExisting = std::make_shared(false); //no mutex required: accessed after thread has finished only! - BasicString filename = objName.c_str(); //using thread safe string without ref-count! - - boost::thread worker([=]() { *isExisting = fun(filename.c_str()); }); //throw() - - if (worker.timed_join(boost::posix_time::milliseconds(timeout))) - return *isExisting ? EXISTING_TRUE : EXISTING_FALSE; - else - return EXISTING_TIMEOUT; - /* - main/worker thread may access different shared_ptr instances safely (even though they have the same target!) - http://www.boost.org/doc/libs/1_43_0/libs/smart_ptr/shared_ptr.htm?sess=8153b05b34d890e02d48730db1ff7ddc#ThreadSafety - */ -} -} - - -util::ResultExist util::fileExists(const Zstring& filename, size_t timeout) //timeout in ms -{ - assert(!filename.empty()); - return ::checkExistence(filename, timeout); -} - - -util::ResultExist util::dirExists(const Zstring& dirname, size_t timeout) //timeout in ms -{ - assert(!dirname.empty()); - return ::checkExistence(dirname, timeout); -} diff --git a/shared/check_exist.h b/shared/check_exist.h index 6ec5534c..14a8a3f8 100644 --- a/shared/check_exist.h +++ b/shared/check_exist.h @@ -3,23 +3,86 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef CHECKEXIST_H_INCLUDED #define CHECKEXIST_H_INCLUDED #include "zstring.h" +#include "boost_thread_wrap.h" //include +#include "file_handling.h" + namespace util { +//check for file or folder existence asynchronously +boost::unique_future somethingExistsAsync(const Zstring& somename); +boost::unique_future fileExistsAsync(const Zstring& filename); +boost::unique_future dirExistsAsync(const Zstring& dirname); + +//some syntactic sugar: enum ResultExist { EXISTING_TRUE, EXISTING_FALSE, - EXISTING_TIMEOUT + EXISTING_NOT_READY }; -ResultExist fileExists(const Zstring& filename, size_t timeout); //timeout in ms -ResultExist dirExists( const Zstring& dirname, size_t timeout); //timeout in ms +ResultExist somethingExists(const Zstring& somename, size_t timeout); +ResultExist fileExists(const Zstring& filename, size_t timeout); +ResultExist dirExists(const Zstring& dirname, size_t timeout); + + + + + + + + + + + + +//################## implementation ########################## +template +boost::unique_future objExistsAsync(const Zstring& objname) +{ + //thread safety: make it a pure value type for use in the thread! + const Zstring objnameVal = objname; //atomic ref-count => binary value-type semantics! + boost::packaged_task pt([=] { return (*fun)(objnameVal); }); + auto fut = pt.get_future(); + boost::thread(std::move(pt)); + return std::move(fut); +} + + +inline +boost::unique_future somethingExistsAsync(const Zstring& somename) { return objExistsAsync<&zen::somethingExists>(somename); } + +inline +boost::unique_future fileExistsAsync(const Zstring& filename) { return objExistsAsync<&zen::fileExists>(filename); } + +inline +boost::unique_future dirExistsAsync(const Zstring& dirname) { return objExistsAsync<&zen::dirExists>(dirname); } + + +template inline +ResultExist objExists(const Zstring& objname, size_t timeout) +{ + auto ft = objExistsAsync(objname); + if (!ft.timed_wait(boost::posix_time::milliseconds(timeout))) + return EXISTING_NOT_READY; + return ft.get() ? EXISTING_TRUE : EXISTING_FALSE; +} + + +inline +ResultExist somethingExists(const Zstring& somename, size_t timeout) { return objExists<&zen::somethingExists>(somename, timeout); } + +inline +ResultExist fileExists(const Zstring& filename, size_t timeout) { return objExists<&zen::fileExists>(filename, timeout); } + +inline +ResultExist dirExists(const Zstring& dirname, size_t timeout) { return objExists<&zen::dirExists>(dirname, timeout); } } #endif // CHECKEXIST_H_INCLUDED diff --git a/shared/com_error.h b/shared/com_error.h index 909e04c1..39f26555 100644 --- a/shared/com_error.h +++ b/shared/com_error.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef COM_ERROR_HEADER #define COM_ERROR_HEADER diff --git a/shared/com_ptr.h b/shared/com_ptr.h index fa1b3e8f..be1776fd 100644 --- a/shared/com_ptr.h +++ b/shared/com_ptr.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef SMART_COM_PTR_H #define SMART_COM_PTR_H diff --git a/shared/com_util.h b/shared/com_util.h index 4a8c4f54..b8fc777d 100644 --- a/shared/com_util.h +++ b/shared/com_util.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef COM_UTILITY_HEADER #define COM_UTILITY_HEADER diff --git a/shared/custom_button.cpp b/shared/custom_button.cpp index 98c0a3cd..0c4c3019 100644 --- a/shared/custom_button.cpp +++ b/shared/custom_button.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "custom_button.h" #include #include diff --git a/shared/custom_button.h b/shared/custom_button.h index 752c763e..8500e59b 100644 --- a/shared/custom_button.h +++ b/shared/custom_button.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef CUSTOMBUTTON_H_INCLUDED #define CUSTOMBUTTON_H_INCLUDED diff --git a/shared/custom_combo_box.cpp b/shared/custom_combo_box.cpp index f6084fdf..fb16a303 100644 --- a/shared/custom_combo_box.cpp +++ b/shared/custom_combo_box.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "custom_combo_box.h" diff --git a/shared/custom_combo_box.h b/shared/custom_combo_box.h index 070790a6..3ddd73b0 100644 --- a/shared/custom_combo_box.h +++ b/shared/custom_combo_box.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef CUSTOMCOMBOBOX_H_INCLUDED #define CUSTOMCOMBOBOX_H_INCLUDED diff --git a/shared/custom_tooltip.cpp b/shared/custom_tooltip.cpp index f19f3822..184c2716 100644 --- a/shared/custom_tooltip.cpp +++ b/shared/custom_tooltip.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "custom_tooltip.h" #include #include diff --git a/shared/custom_tooltip.h b/shared/custom_tooltip.h index c5cb132b..c68856b4 100644 --- a/shared/custom_tooltip.h +++ b/shared/custom_tooltip.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef CUSTOMTOOLTIP_H_INCLUDED #define CUSTOMTOOLTIP_H_INCLUDED diff --git a/shared/debug_log.h b/shared/debug_log.h index 8e8090f0..561eee9d 100644 --- a/shared/debug_log.h +++ b/shared/debug_log.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef DEBUG_LOG_HEADER_017324601673246392184621895740256342 #define DEBUG_LOG_HEADER_017324601673246392184621895740256342 diff --git a/shared/debug_new.cpp b/shared/debug_new.cpp index a7324239..23a26a4e 100644 --- a/shared/debug_new.cpp +++ b/shared/debug_new.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "debug_new.h" #ifdef _MSC_VER diff --git a/shared/debug_new.h b/shared/debug_new.h index afa66a55..b8911b4d 100644 --- a/shared/debug_new.h +++ b/shared/debug_new.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef DEBUGNEW_H_INCLUDED #define DEBUGNEW_H_INCLUDED diff --git a/shared/dir_name.cpp b/shared/dir_name.cpp index 6566bb3a..6945fb9c 100644 --- a/shared/dir_name.cpp +++ b/shared/dir_name.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "dir_name.h" #include #include @@ -40,7 +40,8 @@ void setDirectoryNameImpl(const wxString& dirname, wxDirPickerCtrl* dirPicker, w if (dirPicker) { - if (!dirFormatted.empty() && util::dirExists(toZ(dirFormatted), timeout) == util::EXISTING_TRUE) //potentially slow network access: wait 200ms at most + if (!dirFormatted.empty() && + util::dirExists(toZ(dirFormatted), timeout) == util::EXISTING_TRUE) //potentially slow network access: wait 200ms at most dirPicker->SetPath(dirFormatted); } } diff --git a/shared/dir_name.h b/shared/dir_name.h index 4bf07231..6e783d75 100644 --- a/shared/dir_name.h +++ b/shared/dir_name.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef DRAGANDDROP_H_INCLUDED #define DRAGANDDROP_H_INCLUDED diff --git a/shared/dir_watcher.cpp b/shared/dir_watcher.cpp index 8e0b7f94..9c3a00c7 100644 --- a/shared/dir_watcher.cpp +++ b/shared/dir_watcher.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "dir_watcher.h" #include "last_error.h" #include "i18n.h" @@ -32,23 +32,22 @@ using namespace zen; #ifdef FFS_WIN namespace { -typedef Zbase BasicString; //thread safe string class for file names -typedef Zbase BasicWString; //thread safe string class for UI texts +typedef Zbase BasicWString; //thread safe string class for UI texts struct SharedData { boost::mutex lockAccess; - std::set changedFiles; //get rid of duplicate entries (actually occur!) + std::set changedFiles; //get rid of duplicate entries (actually occur!) BasicWString errorMsg; //non-empty if errors occured in thread }; -void addChanges(SharedData& shared, const char* buffer, DWORD bytesWritten, const BasicString& dirname) //throw () +void addChanges(SharedData& shared, const char* buffer, DWORD bytesWritten, const Zstring& dirname) //throw () { boost::lock_guard dummy(shared.lockAccess); - std::set& output = shared.changedFiles; + std::set& output = shared.changedFiles; if (bytesWritten == 0) //according to docu this may happen in case of internal buffer overflow: report some "dummy" change output.insert(L"Overflow!"); @@ -59,14 +58,14 @@ void addChanges(SharedData& shared, const char* buffer, DWORD bytesWritten, cons { const FILE_NOTIFY_INFORMATION& notifyInfo = reinterpret_cast(*bufPos); - const BasicString fullname = dirname + BasicString(notifyInfo.FileName, notifyInfo.FileNameLength / sizeof(WCHAR)); + const Zstring fullname = dirname + Zstring(notifyInfo.FileName, notifyInfo.FileNameLength / sizeof(WCHAR)); //skip modifications sent by changed directories: reason for change, child element creation/deletion, will notify separately! bool skip = false; if (notifyInfo.Action == FILE_ACTION_MODIFIED) { //note: this check will not work if top watched directory has been renamed - const DWORD ret = ::GetFileAttributes(applyLongPathPrefix(Zstring(fullname)).c_str()); + const DWORD ret = ::GetFileAttributes(applyLongPathPrefix(fullname).c_str()); bool isDir = ret != INVALID_FILE_ATTRIBUTES && (ret & FILE_ATTRIBUTE_DIRECTORY); //returns true for (dir-)symlinks also skip = isDir; } @@ -90,9 +89,7 @@ void getChanges(SharedData& shared, std::vector& output) //throw FileEr if (!shared.errorMsg.empty()) throw zen::FileError(shared.errorMsg.c_str()); - std::transform(shared.changedFiles.begin(), shared.changedFiles.end(), - std::back_inserter(output), [](const BasicString& str) { return Zstring(str); }); - + output.assign(shared.changedFiles.begin(), shared.changedFiles.end()); shared.changedFiles.clear(); } @@ -107,7 +104,7 @@ void reportError(SharedData& shared, const BasicWString& errorMsg) //throw () class ReadChangesAsync { public: - ReadChangesAsync(const BasicString& directory, //make sure to not leak in thread-unsafe types! + ReadChangesAsync(const Zstring& directory, //make sure to not leak in thread-unsafe types! const std::shared_ptr& shared) : shared_(shared), dirname(directory) @@ -239,7 +236,7 @@ private: //shared between main and worker: std::shared_ptr shared_; //worker thread only: - BasicString dirname; //conceptually thread-only, but technically moved to thread-local storage on instance creation: -> must not use ref-copying! + Zstring dirname; //thread safe! HANDLE hDir; }; @@ -250,7 +247,7 @@ public: HandleVolumeRemoval(HANDLE hDir, boost::thread& worker, const std::shared_ptr& shared, - const BasicString& dirname) : + const Zstring& dirname) : NotifyRequestDeviceRemoval(hDir), //throw FileError worker_(worker), shared_(shared), @@ -283,7 +280,7 @@ private: boost::thread& worker_; std::shared_ptr shared_; - BasicString dirname_; + Zstring dirname_; bool removalRequested; bool operationComplete; }; @@ -304,8 +301,8 @@ DirWatcher::DirWatcher(const Zstring& directory) : //throw FileError { pimpl_->shared = std::make_shared(); - ReadChangesAsync reader(BasicString(directory), pimpl_->shared); //throw FileError - pimpl_->volRemoval.reset(new HandleVolumeRemoval(reader.getDirHandle(), pimpl_->worker, pimpl_->shared, BasicString(directory))); //throw FileError + ReadChangesAsync reader(directory, pimpl_->shared); //throw FileError + pimpl_->volRemoval.reset(new HandleVolumeRemoval(reader.getDirHandle(), pimpl_->worker, pimpl_->shared, directory)); //throw FileError pimpl_->worker = boost::thread(std::move(reader)); } diff --git a/shared/dir_watcher.h b/shared/dir_watcher.h index 572515dc..c2bab1d5 100644 --- a/shared/dir_watcher.h +++ b/shared/dir_watcher.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef DIR_WATCHER_348577025748023458 #define DIR_WATCHER_348577025748023458 diff --git a/shared/dll_loader.cpp b/shared/dll_loader.cpp index 029cabc5..4e2c0e65 100644 --- a/shared/dll_loader.cpp +++ b/shared/dll_loader.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "dll_loader.h" #include diff --git a/shared/dll_loader.h b/shared/dll_loader.h index 3efb0d96..252e7598 100644 --- a/shared/dll_loader.h +++ b/shared/dll_loader.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef DLLLOADER_H_INCLUDED #define DLLLOADER_H_INCLUDED @@ -23,7 +23,7 @@ namespace util /* load function from a DLL library, e.g. from kernel32.dll -NOTE: you're allowed to take a static reference to the return value to optimize performance! :) +NOTE: you're allowed to take a static reference to the return value! :) */ template FunctionType getDllFun(const std::wstring& libraryName, const std::string& functionName); diff --git a/shared/dst_hack.cpp b/shared/dst_hack.cpp index a64df448..d52a335f 100644 --- a/shared/dst_hack.cpp +++ b/shared/dst_hack.cpp @@ -28,8 +28,8 @@ Zstring getVolumeName(const Zstring& filename) // volumePath += FILE_NAME_SEPARATOR; Zstring nameFmt = removeLongPathPrefix(filename); //throw() - if (!nameFmt.EndsWith(Zstr("\\"))) - nameFmt += Zstr("\\"); //GetVolumeInformation expects trailing backslash + if (!endsWith(nameFmt, FILE_NAME_SEPARATOR)) + nameFmt += FILE_NAME_SEPARATOR; //GetVolumeInformation expects trailing backslash if (nameFmt.StartsWith(Zstr("\\\\"))) //UNC path: "\\ComputerName\SharedFolder\" { @@ -58,8 +58,6 @@ Zstring getVolumeName(const Zstring& filename) bool dst::isFatDrive(const Zstring& fileName) //throw() { - using namespace zen; - const size_t BUFFER_SIZE = MAX_PATH + 1; wchar_t fsName[BUFFER_SIZE]; diff --git a/shared/file_drop.h b/shared/file_drop.h index c85d4cbb..8b11ccfb 100644 --- a/shared/file_drop.h +++ b/shared/file_drop.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef FILE_DROP_H_INCLUDED #define FILE_DROP_H_INCLUDED diff --git a/shared/file_error.h b/shared/file_error.h index ae9cc83e..d814e05d 100644 --- a/shared/file_error.h +++ b/shared/file_error.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef FILEERROR_H_INCLUDED #define FILEERROR_H_INCLUDED @@ -35,7 +35,7 @@ DEFINE_NEW_FILE_ERROR(ErrorFileLocked); -//facilitate usage of std::wstring for error messages: +//----------- facilitate usage of std::wstring for error messages -------------------- //allow implicit UTF8 conversion: since std::wstring models a GUI string, convenience is more important than performance inline std::wstring operator+(const std::wstring& lhs, const Zstring& rhs) { return std::wstring(lhs) += zen::utf8CvrtTo(rhs); } diff --git a/shared/file_handling.cpp b/shared/file_handling.cpp index a5e7fa9f..6b41f4f5 100644 --- a/shared/file_handling.cpp +++ b/shared/file_handling.cpp @@ -3,11 +3,10 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "file_handling.h" #include #include -#include #include #include "last_error.h" #include "file_traverser.h" @@ -16,6 +15,8 @@ #include "file_io.h" #include "i18n.h" #include "assert_static.h" +#include +#include #ifdef FFS_WIN #include "privilege.h" @@ -24,6 +25,7 @@ #include "long_path_prefix.h" #include #include "dst_hack.h" +#include "file_update_handle.h" #elif defined FFS_LINUX #include @@ -99,68 +101,10 @@ bool zen::somethingExists(const Zstring& objname) //throw() check whether #ifdef FFS_WIN namespace { -//manage file handle to update existing files (temporarily resetting read-only if necessary) -//CreateFileCmd: lambda directly returning non-owned file handle from ::CreateFile() -class FileUpdateHandle -{ -public: - template - FileUpdateHandle(const Zstring& filename, CreateFileCmd cmd) : - filenameFmt(applyLongPathPrefix(filename)), - hFile(INVALID_HANDLE_VALUE), - attr(INVALID_FILE_ATTRIBUTES) - { - hFile = cmd(); - if (hFile != INVALID_HANDLE_VALUE) - return; - - const DWORD lastError = ::GetLastError(); - if (lastError == ERROR_ACCESS_DENIED) //function fails if file is read-only - { - Loki::ScopeGuard guardErrorCode = Loki::MakeGuard(::SetLastError, lastError); //transactional behavior: ensure cleanup (e.g. network drop) -> cref [!] - - //read-only file attribute may cause trouble: temporarily reset it - const DWORD tmpAttr = ::GetFileAttributes(filenameFmt.c_str()); - if (tmpAttr != INVALID_FILE_ATTRIBUTES && (tmpAttr & FILE_ATTRIBUTE_READONLY)) - { - if (::SetFileAttributes(filenameFmt.c_str(), FILE_ATTRIBUTE_NORMAL)) - { - guardErrorCode.Dismiss(); - attr = tmpAttr; //"create" guard on read-only attribute - - //now try again - hFile = cmd(); - } - } - } - } - - ~FileUpdateHandle() - { - if (hFile != INVALID_HANDLE_VALUE) - ::CloseHandle(hFile); - - if (attr != INVALID_FILE_ATTRIBUTES) - ::SetFileAttributes(filenameFmt.c_str(), attr); - } - - //may return INVALID_FILE_ATTRIBUTES, in which case ::GetLastError() may be called directly after FileUpdateHandle() - HANDLE get() const { return hFile; } - -private: - FileUpdateHandle(const FileUpdateHandle&); - FileUpdateHandle& operator=(const FileUpdateHandle&); - - Zstring filenameFmt; - HANDLE hFile; - DWORD attr; -}; - - zen::UInt64 getFileSizeSymlink(const Zstring& linkName) //throw (FileError) { //open handle to target of symbolic link - const HANDLE hFile = ::CreateFile(zen::applyLongPathPrefix(linkName).c_str(), + const HANDLE hFile = ::CreateFile(applyLongPathPrefix(linkName).c_str(), 0, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, @@ -168,28 +112,28 @@ zen::UInt64 getFileSizeSymlink(const Zstring& linkName) //throw (FileError) FILE_FLAG_BACKUP_SEMANTICS, NULL); if (hFile == INVALID_HANDLE_VALUE) - throw FileError(_("Error reading file attributes:") + "\n\"" + linkName + "\"" + "\n\n" + zen::getLastErrorFormatted()); + throw FileError(_("Error reading file attributes:") + "\n\"" + linkName + "\"" + "\n\n" + getLastErrorFormatted()); Loki::ScopeGuard dummy = Loki::MakeGuard(::CloseHandle, hFile); (void)dummy; //silence warning "unused variable" BY_HANDLE_FILE_INFORMATION fileInfo = {}; if (!::GetFileInformationByHandle(hFile, &fileInfo)) - throw FileError(_("Error reading file attributes:") + "\n\"" + linkName + "\"" + "\n\n" + zen::getLastErrorFormatted()); + throw FileError(_("Error reading file attributes:") + "\n\"" + linkName + "\"" + "\n\n" + getLastErrorFormatted()); - return zen::UInt64(fileInfo.nFileSizeLow, fileInfo.nFileSizeHigh); + return UInt64(fileInfo.nFileSizeLow, fileInfo.nFileSizeHigh); } } #endif -zen::UInt64 zen::getFilesize(const Zstring& filename) //throw (FileError) +UInt64 zen::getFilesize(const Zstring& filename) //throw (FileError) { #ifdef FFS_WIN WIN32_FIND_DATA fileInfo = {}; const HANDLE searchHandle = ::FindFirstFile(applyLongPathPrefix(filename).c_str(), &fileInfo); if (searchHandle == INVALID_HANDLE_VALUE) - throw FileError(_("Error reading file attributes:") + "\n\"" + filename + "\"" + "\n\n" + zen::getLastErrorFormatted()); + throw FileError(_("Error reading file attributes:") + "\n\"" + filename + "\"" + "\n\n" + getLastErrorFormatted()); ::FindClose(searchHandle); @@ -197,14 +141,14 @@ zen::UInt64 zen::getFilesize(const Zstring& filename) //throw (FileError) if (isSymbolicLink) return getFileSizeSymlink(filename); //throw (FileError) - return zen::UInt64(fileInfo.nFileSizeLow, fileInfo.nFileSizeHigh); + return UInt64(fileInfo.nFileSizeLow, fileInfo.nFileSizeHigh); #elif defined FFS_LINUX struct stat fileInfo = {}; if (::stat(filename.c_str(), &fileInfo) != 0) //follow symbolic links - throw FileError(_("Error reading file attributes:") + "\n\"" + filename + "\"" + "\n\n" + zen::getLastErrorFormatted()); + throw FileError(_("Error reading file attributes:") + "\n\"" + filename + "\"" + "\n\n" + getLastErrorFormatted()); - return zen::UInt64(fileInfo.st_size); + return UInt64(fileInfo.st_size); #endif } @@ -214,7 +158,7 @@ namespace #ifdef FFS_WIN DWORD retrieveVolumeSerial(const Zstring& pathName) //return 0 on error! { - std::vector buffer(std::max(pathName.size(), static_cast(10000))); + std::vector buffer(10000); //full pathName need not yet exist! if (!::GetVolumePathName(pathName.c_str(), //__in LPCTSTR lpszFileName, @@ -263,14 +207,14 @@ dev_t retrieveVolumeSerial(const Zstring& pathName) //return 0 on error! } -zen::ResponseSameVol zen::onSameVolume(const Zstring& folderLeft, const Zstring& folderRight) //throw() +zen::ResponseSame zen::onSameVolume(const Zstring& folderLeft, const Zstring& folderRight) //throw() { const auto serialLeft = retrieveVolumeSerial(folderLeft); //returns 0 on error! const auto serialRight = retrieveVolumeSerial(folderRight); //returns 0 on error! if (serialLeft == 0 || serialRight == 0) - return VOLUME_CANT_SAY; + return IS_SAME_CANT_SAY; - return serialLeft == serialRight ? VOLUME_SAME : VOLUME_DIFFERENT; + return serialLeft == serialRight ? IS_SAME_YES : IS_SAME_NO; } @@ -302,12 +246,12 @@ bool zen::removeFile(const Zstring& filename) //throw (FileError); #endif //no error situation if file is not existing! manual deletion relies on it! - //perf: place check in error handling block + //perf: check is placed in error handling block //warning: this call changes error code!! if (!somethingExists(filename)) return false; //neither file nor any other object (e.g. broken symlink) with that name existing - throw FileError(_("Error deleting file:") + "\n\"" + filename + "\"" + "\n\n" + zen::getLastErrorFormatted(lastError)); + throw FileError(_("Error deleting file:") + "\n\"" + filename + "\"" + "\n\n" + getLastErrorFormatted(lastError)); } return true; } @@ -364,7 +308,7 @@ void renameFileInternal(const Zstring& oldName, const Zstring& newName) //throw } } - std::wstring errorMessage = _("Error moving file:") + "\n\"" + oldName + "\" ->\n\"" + newName + "\"" + "\n\n" + zen::getLastErrorFormatted(lastError); + std::wstring errorMessage = _("Error moving file:") + "\n\"" + oldName + "\" ->\n\"" + newName + "\"" + "\n\n" + getLastErrorFormatted(lastError); if (lastError == ERROR_NOT_SAME_DEVICE) throw ErrorDifferentVolume(errorMessage); @@ -379,7 +323,7 @@ void renameFileInternal(const Zstring& oldName, const Zstring& newName) //throw { const int lastError = errno; - std::wstring errorMessage = _("Error moving file:") + "\n\"" + oldName + "\" ->\n\"" + newName + "\"" + "\n\n" + zen::getLastErrorFormatted(lastError); + std::wstring errorMessage = _("Error moving file:") + "\n\"" + oldName + "\" ->\n\"" + newName + "\"" + "\n\n" + getLastErrorFormatted(lastError); if (lastError == EXDEV) throw ErrorDifferentVolume(errorMessage); @@ -399,7 +343,7 @@ void renameFileInternal(const Zstring& oldName, const Zstring& newName) //throw template Zstring getFilenameFmt(const Zstring& filename, Function fun) //throw(); returns empty string on error { - const Zstring filenameFmt = zen::applyLongPathPrefix(filename); + const Zstring filenameFmt = applyLongPathPrefix(filename); const DWORD bufferSize = fun(filenameFmt.c_str(), NULL, 0); if (bufferSize == 0) @@ -430,11 +374,11 @@ Zstring createTemp8Dot3Name(const Zstring& fileName) //find a unique 8.3 short n for (int index = 0; index < 100000000; ++index) //filename must be representable by <= 8 characters { const Zstring output = pathPrefix + Zstring::fromNumber(index) + Zchar('.') + extension; - if (!zen::somethingExists(output)) //ensure uniqueness + if (!somethingExists(output)) //ensure uniqueness return output; } - throw std::runtime_error(std::string("100000000 files, one for each number, exist in this directory? You're kidding...\n") + zen::utf8CvrtTo(pathPrefix)); + throw std::runtime_error(std::string("100000000 files, one for each number, exist in this directory? You're kidding...\n") + utf8CvrtTo(pathPrefix)); } @@ -446,7 +390,7 @@ bool fix8Dot3NameClash(const Zstring& oldName, const Zstring& newName) //throw if (newName.find(FILE_NAME_SEPARATOR) == Zstring::npos) return false; - if (zen::somethingExists(newName)) //name OR directory! + if (somethingExists(newName)) //name OR directory! { const Zstring fileNameOrig = newName.AfterLast(FILE_NAME_SEPARATOR); //returns the whole string if ch not found const Zstring fileNameShort = getFilenameFmt(newName, ::GetShortPathName).AfterLast(FILE_NAME_SEPARATOR); //throw() returns empty string on error @@ -467,7 +411,7 @@ bool fix8Dot3NameClash(const Zstring& oldName, const Zstring& newName) //throw //move already existing short name out of the way for now renameFileInternal(unrelatedPathLong, parkedTarget); //throw (FileError: ErrorDifferentVolume); - //DON'T call zen::renameFile() to avoid reentrance! + //DON'T call renameFile() to avoid reentrance! //schedule cleanup; the file system should assign this unrelated file a new (unique) short name Loki::ScopeGuard guard = Loki::MakeGuard(renameFileInternal, parkedTarget, unrelatedPathLong);//equivalent to Boost.ScopeExit in this case @@ -508,7 +452,7 @@ public: virtual void deleteTargetFile(const Zstring& targetFile) { assert(!fileExists(targetFile)); } - virtual void updateCopyStatus(zen::UInt64 totalBytesTransferred) + virtual void updateCopyStatus(UInt64 totalBytesTransferred) { moveCallback.requestUiRefresh(sourceFile_); } @@ -665,7 +609,7 @@ void moveDirectoryImpl(const Zstring& sourceDir, const Zstring& targetDir, bool //move files for (TraverseOneLevel::NameList::const_iterator i = fileList.begin(); i != fileList.end(); ++i) - zen::moveFile(i->second, targetDirFormatted + i->first, ignoreExisting, callback); //throw (FileError: ErrorTargetExisting); + moveFile(i->second, targetDirFormatted + i->first, ignoreExisting, callback); //throw (FileError: ErrorTargetExisting); //move directories for (TraverseOneLevel::NameList::const_iterator i = dirList.begin(); i != dirList.end(); ++i) @@ -753,7 +697,7 @@ void zen::removeDirectory(const Zstring& directory, CallbackRemoveDir* callback) #elif defined FFS_LINUX if (::unlink(directory.c_str()) != 0) #endif - throw FileError(_("Error deleting directory:") + "\n\"" + directory + "\"" + "\n\n" + zen::getLastErrorFormatted()); + throw FileError(_("Error deleting directory:") + "\n\"" + directory + "\"" + "\n\n" + getLastErrorFormatted()); if (callback) callback->notifyDeletion(directory); //once per symlink return; @@ -764,7 +708,7 @@ void zen::removeDirectory(const Zstring& directory, CallbackRemoveDir* callback) //get all files and directories from current directory (WITHOUT subdirectories!) FilesDirsOnlyTraverser traverser(fileList, dirList); - zen::traverseFolder(directory, false, traverser); //don't follow symlinks + traverseFolder(directory, false, traverser); //don't follow symlinks //delete files for (std::vector::const_iterator i = fileList.begin(); i != fileList.end(); ++i) @@ -784,7 +728,7 @@ void zen::removeDirectory(const Zstring& directory, CallbackRemoveDir* callback) if (::rmdir(directory.c_str()) != 0) #endif { - throw FileError(_("Error deleting directory:") + "\n\"" + directory + "\"" + "\n\n" + zen::getLastErrorFormatted()); + throw FileError(_("Error deleting directory:") + "\n\"" + directory + "\"" + "\n\n" + getLastErrorFormatted()); } if (callback) callback->notifyDeletion(directory); //and once per folder } @@ -801,7 +745,7 @@ void zen::copyFileTimes(const Zstring& sourceObj, const Zstring& targetObj, bool if (!::GetFileAttributesEx(applyLongPathPrefix(sourceObj).c_str(), //__in LPCTSTR lpFileName, GetFileExInfoStandard, //__in GET_FILEEX_INFO_LEVELS fInfoLevelId, &sourceAttr)) //__out LPVOID lpFileInformation - throw FileError(_("Error reading file attributes:") + "\n\"" + sourceObj + "\"" + "\n\n" + zen::getLastErrorFormatted()); + throw FileError(_("Error reading file attributes:") + "\n\"" + sourceObj + "\"" + "\n\n" + getLastErrorFormatted()); const bool isReparsePoint = (sourceAttr.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) != 0; const bool isDirectory = (sourceAttr.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0; @@ -816,7 +760,7 @@ void zen::copyFileTimes(const Zstring& sourceObj, const Zstring& targetObj, bool FILE_FLAG_BACKUP_SEMANTICS, //needed to open a directory; no FILE_FLAG_OPEN_REPARSE_POINT => deref symlinks NULL); if (hSource == INVALID_HANDLE_VALUE) - throw FileError(_("Error reading file attributes:") + "\n\"" + sourceObj + "\"" + "\n\n" + zen::getLastErrorFormatted()); + throw FileError(_("Error reading file attributes:") + "\n\"" + sourceObj + "\"" + "\n\n" + getLastErrorFormatted()); Loki::ScopeGuard dummy = Loki::MakeGuard(::CloseHandle, hSource); (void)dummy; //silence warning "unused variable" @@ -825,7 +769,7 @@ void zen::copyFileTimes(const Zstring& sourceObj, const Zstring& targetObj, bool &creationTime, //__out_opt LPFILETIME lpCreationTime, NULL, //__out_opt LPFILETIME lpLastAccessTime, &lastWriteTime)) //__out_opt LPFILETIME lpLastWriteTime - throw FileError(_("Error reading file attributes:") + "\n\"" + sourceObj + "\"" + "\n\n" + zen::getLastErrorFormatted()); + throw FileError(_("Error reading file attributes:") + "\n\"" + sourceObj + "\"" + "\n\n" + getLastErrorFormatted()); } else { @@ -884,7 +828,7 @@ void zen::copyFileTimes(const Zstring& sourceObj, const Zstring& targetObj, bool }); if (targetHandle.get() == INVALID_HANDLE_VALUE) - throw FileError(_("Error changing modification time:") + "\n\"" + targetObj + "\"" + "\n\n" + zen::getLastErrorFormatted()); + throw FileError(_("Error changing modification time:") + "\n\"" + targetObj + "\"" + "\n\n" + getLastErrorFormatted()); /* if (hTarget == INVALID_HANDLE_VALUE && ::GetLastError() == ERROR_SHARING_VIOLATION) @@ -898,10 +842,10 @@ void zen::copyFileTimes(const Zstring& sourceObj, const Zstring& targetObj, bool &creationTime, NULL, &lastWriteTime)) - throw FileError(_("Error changing modification time:") + "\n\"" + targetObj + "\"" + "\n\n" + zen::getLastErrorFormatted()); + throw FileError(_("Error changing modification time:") + "\n\"" + targetObj + "\"" + "\n\n" + getLastErrorFormatted()); #ifndef NDEBUG //dst hack: verify data written - if (dst::isFatDrive(targetObj) && !zen::dirExists(targetObj)) //throw() + if (dst::isFatDrive(targetObj) && !dirExists(targetObj)) //throw() { WIN32_FILE_ATTRIBUTE_DATA debugeAttr = {}; assert(::GetFileAttributesEx(applyLongPathPrefix(targetObj).c_str(), //__in LPCTSTR lpFileName, @@ -918,7 +862,7 @@ void zen::copyFileTimes(const Zstring& sourceObj, const Zstring& targetObj, bool { struct stat objInfo = {}; if (::stat(sourceObj.c_str(), &objInfo) != 0) //read file attributes from source directory - throw FileError(_("Error reading file attributes:") + "\n\"" + sourceObj + "\"" + "\n\n" + zen::getLastErrorFormatted()); + throw FileError(_("Error reading file attributes:") + "\n\"" + sourceObj + "\"" + "\n\n" + getLastErrorFormatted()); struct utimbuf newTimes = {}; newTimes.actime = objInfo.st_atime; @@ -926,13 +870,13 @@ void zen::copyFileTimes(const Zstring& sourceObj, const Zstring& targetObj, bool //(try to) set new "last write time" if (::utime(targetObj.c_str(), &newTimes) != 0) //return value not evaluated! - throw FileError(_("Error changing modification time:") + "\n\"" + targetObj + "\"" + "\n\n" + zen::getLastErrorFormatted()); + throw FileError(_("Error changing modification time:") + "\n\"" + targetObj + "\"" + "\n\n" + getLastErrorFormatted()); } else { struct stat objInfo = {}; if (::lstat(sourceObj.c_str(), &objInfo) != 0) //read file attributes from source directory - throw FileError(_("Error reading file attributes:") + "\n\"" + sourceObj + "\"" + "\n\n" + zen::getLastErrorFormatted()); + throw FileError(_("Error reading file attributes:") + "\n\"" + sourceObj + "\"" + "\n\n" + getLastErrorFormatted()); struct timeval newTimes[2] = {}; newTimes[0].tv_sec = objInfo.st_atime; /* seconds */ @@ -942,7 +886,7 @@ void zen::copyFileTimes(const Zstring& sourceObj, const Zstring& targetObj, bool newTimes[1].tv_usec = 0; /* microseconds */ if (::lutimes(targetObj.c_str(), newTimes) != 0) //return value not evaluated! - throw FileError(_("Error changing modification time:") + "\n\"" + targetObj + "\"" + "\n\n" + zen::getLastErrorFormatted()); + throw FileError(_("Error changing modification time:") + "\n\"" + targetObj + "\"" + "\n\n" + getLastErrorFormatted()); } #endif } @@ -954,7 +898,7 @@ namespace Zstring resolveDirectorySymlink(const Zstring& dirLinkName) //get full target path of symbolic link to a directory; throw (FileError) { //open handle to target of symbolic link - const HANDLE hDir = ::CreateFile(zen::applyLongPathPrefix(dirLinkName).c_str(), + const HANDLE hDir = ::CreateFile(applyLongPathPrefix(dirLinkName).c_str(), 0, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, @@ -962,7 +906,7 @@ Zstring resolveDirectorySymlink(const Zstring& dirLinkName) //get full target pa FILE_FLAG_BACKUP_SEMANTICS, //needed to open a directory NULL); if (hDir == INVALID_HANDLE_VALUE) - throw FileError(_("Error resolving symbolic link:") + "\n\"" + dirLinkName + "\"" + "\n\n" + zen::getLastErrorFormatted()); + throw FileError(_("Error resolving symbolic link:") + "\n\"" + dirLinkName + "\"" + "\n\n" + getLastErrorFormatted()); Loki::ScopeGuard dummy = Loki::MakeGuard(::CloseHandle, hDir); (void)dummy; //silence warning "unused variable" @@ -976,7 +920,7 @@ Zstring resolveDirectorySymlink(const Zstring& dirLinkName) //get full target pa LPTSTR lpszFilePath, DWORD cchFilePath, DWORD dwFlags); - static const GetFinalPathNameByHandleWFunc getFinalPathNameByHandle = + const GetFinalPathNameByHandleWFunc getFinalPathNameByHandle = util::getDllFun(L"kernel32.dll", "GetFinalPathNameByHandleW"); if (getFinalPathNameByHandle == NULL) @@ -991,7 +935,7 @@ Zstring resolveDirectorySymlink(const Zstring& dirLinkName) //get full target pa { std::wstring errorMessage = _("Error resolving symbolic link:") + "\n\"" + dirLinkName + "\""; if (rv == 0) - errorMessage += L"\n\n" + zen::getLastErrorFormatted(); + errorMessage += L"\n\n" + getLastErrorFormatted(); throw FileError(errorMessage); } @@ -1014,7 +958,7 @@ void copySecurityContext(const Zstring& source, const Zstring& target, bool dere errno == EOPNOTSUPP) //extended attributes are not supported by the filesystem return; - throw FileError(_("Error reading security context:") + "\n\"" + source + "\"" + "\n\n" + zen::getLastErrorFormatted()); + throw FileError(_("Error reading security context:") + "\n\"" + source + "\"" + "\n\n" + getLastErrorFormatted()); } Loki::ScopeGuard dummy1 = Loki::MakeGuard(::freecon, contextSource); (void)dummy1; //silence warning "unused variable" @@ -1044,7 +988,7 @@ void copySecurityContext(const Zstring& source, const Zstring& target, bool dere ::setfilecon (target.c_str(), contextSource) : ::lsetfilecon(target.c_str(), contextSource); if (rv3 < 0) - throw FileError(_("Error writing security context:") + "\n\"" + target + "\"" + "\n\n" + zen::getLastErrorFormatted()); + throw FileError(_("Error writing security context:") + "\n\"" + target + "\"" + "\n\n" + getLastErrorFormatted()); } #endif //HAVE_SELINUX @@ -1077,7 +1021,7 @@ void copyObjectPermissions(const Zstring& source, const Zstring& target, bool de PACL sacl = NULL; //http://msdn.microsoft.com/en-us/library/aa364399(v=VS.85).aspx - const HANDLE hSource = ::CreateFile(zen::applyLongPathPrefix(source).c_str(), + const HANDLE hSource = ::CreateFile(applyLongPathPrefix(source).c_str(), READ_CONTROL | ACCESS_SYSTEM_SECURITY, //ACCESS_SYSTEM_SECURITY required for SACL access FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, @@ -1085,7 +1029,7 @@ void copyObjectPermissions(const Zstring& source, const Zstring& target, bool de FILE_FLAG_BACKUP_SEMANTICS | (derefSymlinks ? 0 : FILE_FLAG_OPEN_REPARSE_POINT), //FILE_FLAG_BACKUP_SEMANTICS needed to open a directory NULL); if (hSource == INVALID_HANDLE_VALUE) - throw FileError(_("Error copying file permissions:") + "\n\"" + source + "\" ->\n\"" + target + "\"" + "\n\n" + zen::getLastErrorFormatted() + " (OR)"); + throw FileError(_("Error copying file permissions:") + "\n\"" + source + "\" ->\n\"" + target + "\"" + "\n\n" + getLastErrorFormatted() + " (OR)"); Loki::ScopeGuard dummy = Loki::MakeGuard(::CloseHandle, hSource); (void)dummy; //silence warning "unused variable" @@ -1100,7 +1044,7 @@ void copyObjectPermissions(const Zstring& source, const Zstring& target, bool de &sacl, //__out_opt PACL *ppSacl, &buffer); //__out_opt PSECURITY_DESCRIPTOR *ppSecurityDescriptor if (rc != ERROR_SUCCESS) - throw FileError(_("Error copying file permissions:") + "\n\"" + source + "\" ->\n\"" + target + "\"" + "\n\n" + zen::getLastErrorFormatted(rc) + " (R)"); + throw FileError(_("Error copying file permissions:") + "\n\"" + source + "\" ->\n\"" + target + "\"" + "\n\n" + getLastErrorFormatted(rc) + " (R)"); Loki::ScopeGuard dummy4 = Loki::MakeGuard(::LocalFree, buffer); (void)dummy4; //silence warning "unused variable" @@ -1119,7 +1063,7 @@ void copyObjectPermissions(const Zstring& source, const Zstring& target, bool de }); if (targetHandle.get() == INVALID_HANDLE_VALUE) - throw FileError(_("Error copying file permissions:") + "\n\"" + source + "\" ->\n\"" + target + "\"" + "\n\n" + zen::getLastErrorFormatted() + " (OW)"); + throw FileError(_("Error copying file permissions:") + "\n\"" + source + "\" ->\n\"" + target + "\"" + "\n\n" + getLastErrorFormatted() + " (OW)"); // rc = ::SetNamedSecurityInfo(const_cast(applyLongPathPrefix(target).c_str()), //__in LPTSTR pObjectName, -> does NOT dereference symlinks! rc = ::SetSecurityInfo( @@ -1132,7 +1076,7 @@ void copyObjectPermissions(const Zstring& source, const Zstring& target, bool de sacl); //__in_opt PACL pSacl if (rc != ERROR_SUCCESS) - throw FileError(_("Error copying file permissions:") + "\n\"" + source + "\" ->\n\"" + target + "\"" + "\n\n" + zen::getLastErrorFormatted(rc) + " (W)"); + throw FileError(_("Error copying file permissions:") + "\n\"" + source + "\" ->\n\"" + target + "\"" + "\n\n" + getLastErrorFormatted(rc) + " (W)"); #elif defined FFS_LINUX @@ -1146,7 +1090,7 @@ void copyObjectPermissions(const Zstring& source, const Zstring& target, bool de if (::stat (source.c_str(), &fileInfo) != 0 || ::chown(target.c_str(), fileInfo.st_uid, fileInfo.st_gid) != 0 || // may require admin rights! ::chmod(target.c_str(), fileInfo.st_mode) != 0) - throw FileError(_("Error copying file permissions:") + "\n\"" + source + "\" ->\n\"" + target + "\"" + "\n\n" + zen::getLastErrorFormatted() + " (R)"); + throw FileError(_("Error copying file permissions:") + "\n\"" + source + "\" ->\n\"" + target + "\"" + "\n\n" + getLastErrorFormatted() + " (R)"); } else { @@ -1154,7 +1098,7 @@ void copyObjectPermissions(const Zstring& source, const Zstring& target, bool de if (::lstat (source.c_str(), &fileInfo) != 0 || ::lchown(target.c_str(), fileInfo.st_uid, fileInfo.st_gid) != 0 || // may require admin rights! (!symlinkExists(target) && ::chmod(target.c_str(), fileInfo.st_mode) != 0)) //setting access permissions doesn't make sense for symlinks on Linux: there is no lchmod() - throw FileError(_("Error copying file permissions:") + "\n\"" + source + "\" ->\n\"" + target + "\"" + "\n\n" + zen::getLastErrorFormatted() + " (W)"); + throw FileError(_("Error copying file permissions:") + "\n\"" + source + "\" ->\n\"" + target + "\"" + "\n\n" + getLastErrorFormatted() + " (W)"); } #endif } @@ -1163,8 +1107,8 @@ void copyObjectPermissions(const Zstring& source, const Zstring& target, bool de namespace { //provide uniform binary interface: -void removeDirSimple(const Zstring& directory) { zen::removeDirectory(directory); } //throw (FileError) -void removeFileSimple(const Zstring& filename) { zen::removeFile(filename); } //throw (FileError) +void removeDirSimple(const Zstring& directory) { removeDirectory(directory); } //throw (FileError) +void removeFileSimple(const Zstring& filename) { removeFile(filename); } //throw (FileError) } @@ -1172,7 +1116,7 @@ void createDirectoryRecursively(const Zstring& directory, const Zstring& templat { using namespace zen; - if (zen::dirExists(directory)) + if (dirExists(directory)) return; if (level == 100) //catch endless recursion @@ -1180,7 +1124,7 @@ void createDirectoryRecursively(const Zstring& directory, const Zstring& templat //try to create parent folders first const Zstring dirParent = directory.BeforeLast(FILE_NAME_SEPARATOR); - if (!dirParent.empty() && !zen::dirExists(dirParent)) + if (!dirParent.empty() && !dirExists(dirParent)) { //call function recursively const Zstring templateParent = templateDir.BeforeLast(FILE_NAME_SEPARATOR); @@ -1201,7 +1145,7 @@ void createDirectoryRecursively(const Zstring& directory, const Zstring& templat #endif { if (level != 0) return; - throw FileError(_("Error creating directory:") + "\n\"" + directory + "\"" + "\n\n" + zen::getLastErrorFormatted()); + throw FileError(_("Error creating directory:") + "\n\"" + directory + "\"" + "\n\n" + getLastErrorFormatted()); } if (!templateDir.empty()) @@ -1314,7 +1258,7 @@ void zen::copySymlink(const Zstring& sourceLink, const Zstring& targetLink, zen: #ifdef FFS_WIN //dynamically load windows API function typedef BOOLEAN (WINAPI *CreateSymbolicLinkFunc)(LPCTSTR lpSymlinkFileName, LPCTSTR lpTargetFileName, DWORD dwFlags); - static const CreateSymbolicLinkFunc createSymbolicLink = util::getDllFun(L"kernel32.dll", "CreateSymbolicLinkW"); + const CreateSymbolicLinkFunc createSymbolicLink = util::getDllFun(L"kernel32.dll", "CreateSymbolicLinkW"); if (createSymbolicLink == NULL) throw FileError(_("Error loading library function:") + "\n\"" + "CreateSymbolicLinkW" + "\""); @@ -1322,11 +1266,11 @@ void zen::copySymlink(const Zstring& sourceLink, const Zstring& targetLink, zen: targetLink.c_str(), //__in LPTSTR lpSymlinkFileName, linkPath.c_str(), //__in LPTSTR lpTargetFileName, (type == SYMLINK_TYPE_DIR ? SYMBOLIC_LINK_FLAG_DIRECTORY : 0))) //__in DWORD dwFlags - throw FileError(_("Error copying symbolic link:") + "\n\"" + sourceLink + "\" ->\n\"" + targetLink + "\"" + "\n\n" + zen::getLastErrorFormatted()); + throw FileError(_("Error copying symbolic link:") + "\n\"" + sourceLink + "\" ->\n\"" + targetLink + "\"" + "\n\n" + getLastErrorFormatted()); #elif defined FFS_LINUX if (::symlink(linkPath.c_str(), targetLink.c_str()) != 0) - throw FileError(_("Error copying symbolic link:") + "\n\"" + sourceLink + "\" ->\n\"" + targetLink + "\"" + "\n\n" + zen::getLastErrorFormatted()); + throw FileError(_("Error copying symbolic link:") + "\n\"" + sourceLink + "\" ->\n\"" + targetLink + "\"" + "\n\n" + getLastErrorFormatted()); #endif //allow only consistent objects to be created -> don't place before ::symlink, targetLink may already exist @@ -1351,7 +1295,7 @@ Zstring createTempName(const Zstring& filename) Zstring output = filename + zen::TEMP_FILE_ENDING; //ensure uniqueness - for (int i = 1; zen::somethingExists(output); ++i) + for (int i = 1; somethingExists(output); ++i) output = filename + Zchar('_') + Zstring::fromNumber(i) + zen::TEMP_FILE_ENDING; return output; @@ -1362,11 +1306,13 @@ struct CallbackData { CallbackData(CallbackCopyFile& cb) : callback(cb), + callNr(0), exceptionCaught(false) {} CallbackCopyFile& callback; + size_t callNr; bool exceptionCaught; - zen::UInt64 bytesTransferredOnException; + UInt64 bytesTransferredOnException; }; @@ -1381,14 +1327,13 @@ DWORD CALLBACK copyCallbackInternal( HANDLE hDestinationFile, LPVOID lpData) { - //small performance optimization: it seems this callback function is called for every 64 kB (depending on cluster size). - static size_t callNr = 0; - if (++callNr % 4 == 0) //executing callback every 256 kB should suffice + if (lpData) { - if (lpData) - { - CallbackData& cbd = *static_cast(lpData); + CallbackData& cbd = *static_cast(lpData); + //small performance optimization: it seems this callback function is called for every 64 kB (depending on cluster size). + if (++cbd.callNr % 4 == 0) //executing callback every 256 kB should suffice + { //some odd check for some possible(?) error condition if (totalBytesTransferred.QuadPart < 0) //let's see if someone answers the call... ::MessageBox(NULL, L"You've just discovered a bug in WIN32 API function \"CopyFileEx\"! \n\n\ @@ -1398,12 +1343,15 @@ DWORD CALLBACK copyCallbackInternal( NULL, 0); try { - cbd.callback.updateCopyStatus(zen::UInt64(totalBytesTransferred.QuadPart)); + cbd.callback.updateCopyStatus(UInt64(totalBytesTransferred.QuadPart)); } catch (...) { +#ifndef _MSC_VER +#warning migrate to std::exception_ptr when available +#endif cbd.exceptionCaught = true; - cbd.bytesTransferredOnException = zen::UInt64(totalBytesTransferred.QuadPart); + cbd.bytesTransferredOnException = UInt64(totalBytesTransferred.QuadPart); return PROGRESS_CANCEL; } } @@ -1413,23 +1361,6 @@ DWORD CALLBACK copyCallbackInternal( } -#ifndef COPY_FILE_COPY_SYMLINK -#define COPY_FILE_COPY_SYMLINK 0x00000800 -#endif - -bool supportForSymbolicLinks() -{ - OSVERSIONINFO osvi = {}; - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - - //symbolic links are supported starting with Vista - if (::GetVersionEx(&osvi)) - return osvi.dwMajorVersion > 5; //XP has majorVersion == 5, minorVersion == 1; Vista majorVersion == 6, dwMinorVersion == 0 - //overview: http://msdn.microsoft.com/en-us/library/ms724834(VS.85).aspx - return false; -} - - #ifndef COPY_FILE_ALLOW_DECRYPTED_DESTINATION #define COPY_FILE_ALLOW_DECRYPTED_DESTINATION 0x00000008 #endif @@ -1456,12 +1387,12 @@ void rawCopyWinApi(const Zstring& sourceFile, DWORD copyFlags = COPY_FILE_FAIL_IF_EXISTS; - // static const bool symlinksSupported = supportForSymbolicLinks(); //only set "true" if supported by OS: else copying in Windows XP fails - // if (copyFileSymLinks && symlinksSupported) - // copyFlags |= COPY_FILE_COPY_SYMLINK; - //allow copying from encrypted to non-encrytped location - static const bool nonEncSupported = supportForNonEncryptedDestination(); + + static bool nonEncSupported = false; + static boost::once_flag once = BOOST_ONCE_INIT; //caveat: function scope static initialization is not thread-safe in VS 2010! + boost::call_once(once, []() { nonEncSupported = supportForNonEncryptedDestination(); }); + if (nonEncSupported) copyFlags |= COPY_FILE_ALLOW_DECRYPTED_DESTINATION; @@ -1484,7 +1415,7 @@ void rawCopyWinApi(const Zstring& sourceFile, //assemble error message... std::wstring errorMessage = _("Error copying file:") + "\n\"" + sourceFile + "\" ->\n\"" + targetFile + "\"" + - "\n\n" + zen::getLastErrorFormatted(lastError); + "\n\n" + getLastErrorFormatted(lastError); //if file is locked (try to) use Windows Volume Shadow Copy Service if (lastError == ERROR_SHARING_VIOLATION || @@ -1508,7 +1439,7 @@ void rawCopyWinApi(const Zstring& sourceFile, //trying to copy > 4GB file to FAT/FAT32 volume gives obscure ERROR_INVALID_PARAMETER (FAT can indeed handle files up to 4 Gig, tested!) if (lastError == ERROR_INVALID_PARAMETER && dst::isFatDrive(targetFile) && - getFilesize(sourceFile) >= 4U * zen::UInt64(1024U * 1024 * 1024)) //throw (FileError) + getFilesize(sourceFile) >= 4U * UInt64(1024U * 1024 * 1024)) //throw (FileError) errorMessage += L"\nFAT volume cannot store files larger than 4 gigabyte!"; } catch(...) {} @@ -1555,7 +1486,7 @@ void rawCopyWinApi(const Zstring& sourceFile, // */ // // //open sourceFile for reading -// HANDLE hFileIn = ::CreateFile(zen::applyLongPathPrefix(sourceFile).c_str(), +// HANDLE hFileIn = ::CreateFile(applyLongPathPrefix(sourceFile).c_str(), // GENERIC_READ, // FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, //all shared modes are required to read files that are open in other applications // NULL, @@ -1565,7 +1496,7 @@ void rawCopyWinApi(const Zstring& sourceFile, // if (hFileIn == INVALID_HANDLE_VALUE) // { // const DWORD lastError = ::GetLastError(); -// const std::wstring& errorMessage = _("Error opening file:") + "\n\"" + sourceFile + "\"" + "\n\n" + zen::getLastErrorFormatted(lastError); +// const std::wstring& errorMessage = _("Error opening file:") + "\n\"" + sourceFile + "\"" + "\n\n" + getLastErrorFormatted(lastError); // // //if file is locked (try to) use Windows Volume Shadow Copy Service // if (lastError == ERROR_SHARING_VIOLATION || @@ -1580,7 +1511,7 @@ void rawCopyWinApi(const Zstring& sourceFile, // // BY_HANDLE_FILE_INFORMATION infoFileIn = {}; // if (!::GetFileInformationByHandle(hFileIn, &infoFileIn)) -// throw FileError(_("Error reading file attributes:") + "\n\"" + sourceFile + "\"" + "\n\n" + zen::getLastErrorFormatted()); +// throw FileError(_("Error reading file attributes:") + "\n\"" + sourceFile + "\"" + "\n\n" + getLastErrorFormatted()); // // //####################################### DST hack ########################################### // if (dst::isFatDrive(sourceFile)) //throw() @@ -1609,7 +1540,7 @@ void rawCopyWinApi(const Zstring& sourceFile, // FILE_ATTRIBUTE_ENCRYPTED; // // //create targetFile and open it for writing -// HANDLE hFileOut = ::CreateFile(zen::applyLongPathPrefix(targetFile).c_str(), +// HANDLE hFileOut = ::CreateFile(applyLongPathPrefix(targetFile).c_str(), // GENERIC_READ | GENERIC_WRITE, //read access required for FSCTL_SET_COMPRESSION // FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, // NULL, @@ -1620,7 +1551,7 @@ void rawCopyWinApi(const Zstring& sourceFile, // { // const DWORD lastError = ::GetLastError(); // const std::wstring& errorMessage = _("Error writing file:") + "\n\"" + targetFile + "\"" + -// "\n\n" + zen::getLastErrorFormatted(lastError); +// "\n\n" + getLastErrorFormatted(lastError); // // if (lastError == ERROR_FILE_EXISTS) // throw ErrorTargetExisting(errorMessage); @@ -1648,7 +1579,7 @@ void rawCopyWinApi(const Zstring& sourceFile, // &fsFlags, //__out_opt LPDWORD lpFileSystemFlags, // NULL, //__out LPTSTR lpFileSystemNameBuffer, // 0)) //__in DWORD nFileSystemNameSize -// throw FileError(_("Error reading file attributes:") + "\n\"" + sourceFile + "\"" + "\n\n" + zen::getLastErrorFormatted()); +// throw FileError(_("Error reading file attributes:") + "\n\"" + sourceFile + "\"" + "\n\n" + getLastErrorFormatted()); // // const bool sourceIsEncrypted = (infoFileIn.dwFileAttributes & FILE_ATTRIBUTE_ENCRYPTED) != 0; // const bool sourceIsCompressed = (infoFileIn.dwFileAttributes & FILE_ATTRIBUTE_COMPRESSED) != 0; @@ -1675,7 +1606,7 @@ void rawCopyWinApi(const Zstring& sourceFile, // &bytesReturned, //number of bytes returned // NULL)) //OVERLAPPED structure // throw FileError(_("Error writing file:") + "\n\"" + targetFile + "\"" + -// "\n\n" + zen::getLastErrorFormatted() + +// "\n\n" + getLastErrorFormatted() + // "\nFailed to write NTFS compressed attribute!"); // } // @@ -1694,14 +1625,17 @@ void rawCopyWinApi(const Zstring& sourceFile, // &bytesReturned, //number of bytes returned // NULL)) //OVERLAPPED structure // throw FileError(_("Error writing file:") + "\n\"" + targetFile + "\"" + -// "\n\n" + zen::getLastErrorFormatted() + +// "\n\n" + getLastErrorFormatted() + // "\nFailed to write NTFS sparse attribute!"); // } // } // // // const DWORD BUFFER_SIZE = 512 * 1024; //512 kb seems to be a reasonable buffer size -// static const boost::scoped_array memory(new BYTE[BUFFER_SIZE]); +// static boost::thread_specific_ptr> cpyBuf; +// if (!cpyBuf.get()) +// cpyBuf.reset(new std::vector(BUFFER_SIZE)); //512 kb seems to be a reasonable buffer size +// std::vector& buffer = *cpyBuf; // // struct ManageCtxt //manage context for BackupRead()/BackupWrite() // { @@ -1719,7 +1653,7 @@ void rawCopyWinApi(const Zstring& sourceFile, // } context; // // //copy contents of sourceFile to targetFile -// zen::UInt64 totalBytesTransferred; +// UInt64 totalBytesTransferred; // // bool eof = false; // do @@ -1729,22 +1663,22 @@ void rawCopyWinApi(const Zstring& sourceFile, // if (useBackupFun) // { // if (!::BackupRead(hFileIn, //__in HANDLE hFile, -// memory.get(), //__out LPBYTE lpBuffer, +// &buffer[0], //__out LPBYTE lpBuffer, // BUFFER_SIZE, //__in DWORD nNumberOfBytesToRead, // &bytesRead, //__out LPDWORD lpNumberOfBytesRead, // false, //__in BOOL bAbort, // false, //__in BOOL bProcessSecurity, // &context.read)) //__out LPVOID *lpContext // throw FileError(_("Error reading file:") + "\n\"" + sourceFile + "\"" + -// "\n\n" + zen::getLastErrorFormatted()); +// "\n\n" + getLastErrorFormatted()); // } // else if (!::ReadFile(hFileIn, //__in HANDLE hFile, -// memory.get(), //__out LPVOID lpBuffer, +// &buffer[0], //__out LPVOID lpBuffer, // BUFFER_SIZE, //__in DWORD nNumberOfBytesToRead, // &bytesRead, //__out_opt LPDWORD lpNumberOfBytesRead, // NULL)) //__inout_opt LPOVERLAPPED lpOverlapped // throw FileError(_("Error reading file:") + "\n\"" + sourceFile + "\"" + -// "\n\n" + zen::getLastErrorFormatted()); +// "\n\n" + getLastErrorFormatted()); // // if (bytesRead > BUFFER_SIZE) // throw FileError(_("Error reading file:") + "\n\"" + sourceFile + "\"" + @@ -1758,22 +1692,22 @@ void rawCopyWinApi(const Zstring& sourceFile, // if (useBackupFun) // { // if (!::BackupWrite(hFileOut, //__in HANDLE hFile, -// memory.get(), //__in LPBYTE lpBuffer, +// &buffer[0], //__in LPBYTE lpBuffer, // bytesRead, //__in DWORD nNumberOfBytesToWrite, // &bytesWritten, //__out LPDWORD lpNumberOfBytesWritten, // false, //__in BOOL bAbort, // false, //__in BOOL bProcessSecurity, // &context.write)) //__out LPVOID *lpContext // throw FileError(_("Error writing file:") + "\n\"" + targetFile + "\"" + -// "\n\n" + zen::getLastErrorFormatted() + " (w)"); //w -> distinguish from fopen error message! +// "\n\n" + getLastErrorFormatted() + " (w)"); //w -> distinguish from fopen error message! // } // else if (!::WriteFile(hFileOut, //__in HANDLE hFile, -// memory.get(), //__out LPVOID lpBuffer, +// &buffer[0], //__out LPVOID lpBuffer, // bytesRead, //__in DWORD nNumberOfBytesToWrite, // &bytesWritten, //__out_opt LPDWORD lpNumberOfBytesWritten, // NULL)) //__inout_opt LPOVERLAPPED lpOverlapped // throw FileError(_("Error writing file:") + "\n\"" + targetFile + "\"" + -// "\n\n" + zen::getLastErrorFormatted() + " (w)"); //w -> distinguish from fopen error message! +// "\n\n" + getLastErrorFormatted() + " (w)"); //w -> distinguish from fopen error message! // // if (bytesWritten != bytesRead) // throw FileError(_("Error writing file:") + "\n\"" + targetFile + "\"" + "\n\n" + "incomplete write"); @@ -1803,7 +1737,7 @@ void rawCopyWinApi(const Zstring& sourceFile, // { // LARGE_INTEGER inputSize = {}; // if (!::GetFileSizeEx(hFileIn, &inputSize)) -// throw FileError(_("Error reading file attributes:") + "\n\"" + sourceFile + "\"" + "\n\n" + zen::getLastErrorFormatted()); +// throw FileError(_("Error reading file attributes:") + "\n\"" + sourceFile + "\"" + "\n\n" + getLastErrorFormatted()); // // if (inputSize.QuadPart != 0) // throw FileError(_("Error reading file:") + "\n\"" + sourceFile + "\"" + "\n\n" + "unknown error"); @@ -1814,7 +1748,7 @@ void rawCopyWinApi(const Zstring& sourceFile, // &infoFileIn.ftCreationTime, // NULL, // &infoFileIn.ftLastWriteTime)) -// throw FileError(_("Error changing modification time:") + "\n\"" + targetFile + "\"" + "\n\n" + zen::getLastErrorFormatted()); +// throw FileError(_("Error changing modification time:") + "\n\"" + targetFile + "\"" + "\n\n" + getLastErrorFormatted()); // // //#ifndef NDEBUG //dst hack: verify data written @@ -1878,10 +1812,13 @@ void rawCopyStream(const Zstring& sourceFile, //create targetFile and open it for writing FileOutput fileOut(targetFile, FileOutput::ACC_CREATE_NEW); //throw (FileError: ErrorTargetPathMissing, ErrorTargetExisting) - static std::vector buffer(512 * 1024); //512 kb seems to be a reasonable buffer size + static boost::thread_specific_ptr> cpyBuf; + if (!cpyBuf.get()) + cpyBuf.reset(new std::vector(512 * 1024)); //512 kb seems to be a reasonable buffer size + std::vector& buffer = *cpyBuf; //copy contents of sourceFile to targetFile - zen::UInt64 totalBytesTransferred; + UInt64 totalBytesTransferred; do { const size_t bytesRead = fileIn.read(&buffer[0], buffer.size()); //throw (FileError) @@ -1944,7 +1881,7 @@ void zen::copyFile(const Zstring& sourceFile, //throw (FileError: ErrorTargetPat CallbackCopyFile* callback) { Zstring temporary = targetFile + zen::TEMP_FILE_ENDING; //use temporary file until a correct date has been set - Loki::ScopeGuard guardTempFile = Loki::MakeGuard(&removeFile, boost::cref(temporary)); //transactional behavior: ensure cleanup (e.g. network drop) -> cref [!] + Loki::ScopeGuard guardTempFile = Loki::MakeGuard([&]() { removeFile(temporary); }); //transactional behavior: ensure cleanup (e.g. network drop) -> ref to temporary[!] //raw file copy try diff --git a/shared/file_handling.h b/shared/file_handling.h index 0ee4b1e9..113168f3 100644 --- a/shared/file_handling.h +++ b/shared/file_handling.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef FILE_HANDLING_H_INCLUDED #define FILE_HANDLING_H_INCLUDED @@ -25,13 +25,15 @@ bool somethingExists(const Zstring& objname); //throw() check whether any //check whether two folders are located on the same (logical) volume //left and right directories NEED NOT yet exist! volume prefix is sufficient! path may end with PATH_SEPARATOR -enum ResponseSameVol +enum ResponseSame { - VOLUME_SAME, - VOLUME_DIFFERENT, - VOLUME_CANT_SAY + IS_SAME_YES, + IS_SAME_NO, + IS_SAME_CANT_SAY }; -ResponseSameVol onSameVolume(const Zstring& folderLeft, const Zstring& folderRight); //throw() +ResponseSame onSameVolume(const Zstring& folderLeft, const Zstring& folderRight); //throw() + +void checkthis(const Zstring& folderLeft); //throw() //copy file or directory create/last change date, void copyFileTimes(const Zstring& sourceDir, const Zstring& targetDir, bool derefSymlinks); //throw (FileError) diff --git a/shared/file_id.cpp b/shared/file_id.cpp index da8fd815..e6c016e7 100644 --- a/shared/file_id.cpp +++ b/shared/file_id.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "file_id.h" #ifdef FFS_WIN @@ -18,8 +18,7 @@ namespace { -template -inline +template inline std::string numberToBytes(T number) { const char* rawBegin = reinterpret_cast(&number); diff --git a/shared/file_id.h b/shared/file_id.h index 2e94bf5a..eaf47e3c 100644 --- a/shared/file_id.h +++ b/shared/file_id.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef FILEID_H_INCLUDED #define FILEID_H_INCLUDED diff --git a/shared/file_io.cpp b/shared/file_io.cpp index c19101aa..2614ac06 100644 --- a/shared/file_io.cpp +++ b/shared/file_io.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "file_io.h" #include "last_error.h" #include "i18n.h" diff --git a/shared/file_io.h b/shared/file_io.h index 79b521f1..6f87845b 100644 --- a/shared/file_io.h +++ b/shared/file_io.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef FILEIO_H_INCLUDED #define FILEIO_H_INCLUDED diff --git a/shared/file_traverser.cpp b/shared/file_traverser.cpp index aced3487..595b2768 100644 --- a/shared/file_traverser.cpp +++ b/shared/file_traverser.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "file_traverser.h" #include #include "last_error.h" @@ -14,6 +14,7 @@ #include //includes "windows.h" #include "long_path_prefix.h" #include "dst_hack.h" +#include "file_update_handle.h" #elif defined FFS_LINUX #include @@ -57,7 +58,7 @@ inline zen::Int64 filetimeToTimeT(const FILETIME& lastWriteTime) { //convert UTC FILETIME to ANSI C format (number of seconds since Jan. 1st 1970 UTC) - zen::Int64 writeTimeLong = zen::to(zen::UInt64(lastWriteTime.dwLowDateTime, lastWriteTime.dwHighDateTime) / 10000000U); //reduce precision to 1 second (FILETIME has unit 10^-7 s) + zen::Int64 writeTimeLong = to(zen::UInt64(lastWriteTime.dwLowDateTime, lastWriteTime.dwHighDateTime) / 10000000U); //reduce precision to 1 second (FILETIME has unit 10^-7 s) writeTimeLong -= zen::Int64(3054539008UL, 2); //timeshift between ansi C time and FILETIME in seconds == 11644473600s return writeTimeLong; } @@ -126,14 +127,12 @@ public: } private: - DirTraverser(const DirTraverser&); - DirTraverser& operator=(const DirTraverser&); + DirTraverser(const DirTraverser&); + DirTraverser& operator=(const DirTraverser&); template void traverse(const Zstring& directory, zen::TraverseCallback& sink, int level) { - using namespace zen; - tryReportingError([&](std::wstring& errorMsg) -> bool { if (level == 100) //notify endless recursion @@ -146,19 +145,16 @@ private: #ifdef FFS_WIN - //ensure directoryFormatted ends with backslash - const Zstring& directoryFormatted = directory.EndsWith(FILE_NAME_SEPARATOR) ? - directory : - directory + FILE_NAME_SEPARATOR; - + //ensure directoryPf ends with backslash + const Zstring& directoryPf = directory.EndsWith(FILE_NAME_SEPARATOR) ? + directory : + directory + FILE_NAME_SEPARATOR; WIN32_FIND_DATA fileInfo = {}; HANDLE searchHandle = INVALID_HANDLE_VALUE; tryReportingError([&](std::wstring& errorMsg) -> bool { - searchHandle = ::FindFirstFile( - applyLongPathPrefix(directoryFormatted + Zchar('*')).c_str(), //__in LPCTSTR lpFileName - &fileInfo); //__out LPWIN32_FIND_DATA lpFindFileData + searchHandle = ::FindFirstFile(applyLongPathPrefix(directoryPf + L'*').c_str(), &fileInfo); //no noticable performance difference compared to FindFirstFileEx with FindExInfoBasic, FIND_FIRST_EX_CASE_SENSITIVE and/or FIND_FIRST_EX_LARGE_FETCH if (searchHandle == INVALID_HANDLE_VALUE) @@ -188,7 +184,7 @@ private: (shortName[1] == L'\0' || (shortName[1] == L'.' && shortName[2] == L'\0'))) continue; - const Zstring& fullName = directoryFormatted + shortName; + const Zstring& fullName = directoryPf + shortName; const bool isSymbolicLink = (fileInfo.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) != 0; @@ -254,7 +250,7 @@ private: details.fileSize = zen::UInt64(fileInfo.nFileSizeLow, fileInfo.nFileSizeHigh); } - sink.onFile(shortName, fullName, details); + sink.onFile(shortName, fullName, details); } } while ([&]() -> bool @@ -322,7 +318,7 @@ private: //don't return "." and ".." - const Zchar* const shortName = dirEntry->d_name; + const char* const shortName = dirEntry->d_name; if (shortName[0] == '.' && (shortName[1] == '\0' || (shortName[1] == '.' && shortName[2] == '\0'))) continue; @@ -421,23 +417,25 @@ private: const dst::RawTime encodedTime = dst::fatEncodeUtcTime(i->second); //throw (std::runtime_error) { - HANDLE hTarget = ::CreateFile(zen::applyLongPathPrefix(i->first).c_str(), - GENERIC_WRITE, //just FILE_WRITE_ATTRIBUTES may not be enough for some NAS shares! - FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, - NULL, - OPEN_EXISTING, - FILE_FLAG_BACKUP_SEMANTICS, - NULL); - if (hTarget == INVALID_HANDLE_VALUE) + //may need to remove the readonly-attribute (e.g. FAT usb drives) + FileUpdateHandle updateHandle(i->first, [=]() + { + return ::CreateFile(zen::applyLongPathPrefix(i->first).c_str(), + GENERIC_WRITE, //just FILE_WRITE_ATTRIBUTES may not be enough for some NAS shares! + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + NULL, + OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS, + NULL); + }); + if (updateHandle.get() == INVALID_HANDLE_VALUE) { ++failedAttempts; assert(false); //don't throw exceptions due to dst hack here continue; } - Loki::ScopeGuard dummy = Loki::MakeGuard(::CloseHandle, hTarget); - (void)dummy; //silence warning "unused variable" - if (!::SetFileTime(hTarget, + if (!::SetFileTime(updateHandle.get(), &encodedTime.createTimeRaw, NULL, &encodedTime.writeTimeRaw)) @@ -483,7 +481,7 @@ void zen::traverseFolder(const Zstring& directory, bool followSymlinks, Traverse #ifdef FFS_WIN try //traversing certain folders with restricted permissions requires this privilege! (but copying these files may still fail) { - zen::Privileges::getInstance().ensureActive(SE_BACKUP_NAME); //throw (FileError) + zen::Privileges::getInstance().ensureActive(SE_BACKUP_NAME); //throw FileError } catch (...) {} //don't cause issues in user mode #endif diff --git a/shared/file_traverser.h b/shared/file_traverser.h index 18d692df..aa9dffad 100644 --- a/shared/file_traverser.h +++ b/shared/file_traverser.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef FILETRAVERSER_H_INCLUDED #define FILETRAVERSER_H_INCLUDED diff --git a/shared/file_update_handle.h b/shared/file_update_handle.h new file mode 100644 index 00000000..1ffb7000 --- /dev/null +++ b/shared/file_update_handle.h @@ -0,0 +1,67 @@ +#ifndef FILE_UPDATE_HANDLE_H_INCLUDED +#define FILE_UPDATE_HANDLE_H_INCLUDED + +#include //includes "windows.h" +#include "long_path_prefix.h" + +namespace +{ +//manage file handle to update existing files (temporarily resetting read-only if necessary) +//CreateFileCmd: lambda directly returning non-owned file handle from ::CreateFile() +class FileUpdateHandle +{ +public: + template + FileUpdateHandle(const Zstring& filename, CreateFileCmd cmd) : + filenameFmt(zen::applyLongPathPrefix(filename)), + hFile(INVALID_HANDLE_VALUE), + attr(INVALID_FILE_ATTRIBUTES) + { + hFile = cmd(); + if (hFile != INVALID_HANDLE_VALUE) + return; + + const DWORD lastError = ::GetLastError(); + if (lastError == ERROR_ACCESS_DENIED) //function fails if file is read-only + { + Loki::ScopeGuard guardErrorCode = Loki::MakeGuard(::SetLastError, lastError); //transactional behavior: ensure cleanup (e.g. network drop) -> cref [!] + + //read-only file attribute may cause trouble: temporarily reset it + const DWORD tmpAttr = ::GetFileAttributes(filenameFmt.c_str()); + if (tmpAttr != INVALID_FILE_ATTRIBUTES && (tmpAttr & FILE_ATTRIBUTE_READONLY)) + { + if (::SetFileAttributes(filenameFmt.c_str(), FILE_ATTRIBUTE_NORMAL)) + { + guardErrorCode.Dismiss(); + attr = tmpAttr; //"create" guard on read-only attribute + + //now try again + hFile = cmd(); + } + } + } + } + + ~FileUpdateHandle() + { + if (hFile != INVALID_HANDLE_VALUE) + ::CloseHandle(hFile); + + if (attr != INVALID_FILE_ATTRIBUTES) + ::SetFileAttributes(filenameFmt.c_str(), attr); + } + + //may return INVALID_FILE_ATTRIBUTES, in which case ::GetLastError() may be called directly after FileUpdateHandle() + HANDLE get() const { return hFile; } + +private: + FileUpdateHandle(const FileUpdateHandle&); + FileUpdateHandle& operator=(const FileUpdateHandle&); + + Zstring filenameFmt; + HANDLE hFile; + DWORD attr; +}; +} + +#endif // FILE_UPDATE_HANDLE_H_INCLUDED diff --git a/shared/global_func.h b/shared/global_func.h index bf9f13dd..861e2081 100644 --- a/shared/global_func.h +++ b/shared/global_func.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef GLOBALFUNCTIONS_H_INCLUDED #define GLOBALFUNCTIONS_H_INCLUDED diff --git a/shared/guid.cpp b/shared/guid.cpp index 1580a62d..1cc304cb 100644 --- a/shared/guid.cpp +++ b/shared/guid.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "guid.h" #include diff --git a/shared/guid.h b/shared/guid.h index 166e9eb1..1986b101 100644 --- a/shared/guid.h +++ b/shared/guid.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef GUID_H_INCLUDED #define GUID_H_INCLUDED diff --git a/shared/help_provider.cpp b/shared/help_provider.cpp index 2c5d5aa9..7eb043cd 100644 --- a/shared/help_provider.cpp +++ b/shared/help_provider.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "help_provider.h" #include #include "standard_paths.h" diff --git a/shared/help_provider.h b/shared/help_provider.h index 01ac3054..dbe3ce26 100644 --- a/shared/help_provider.h +++ b/shared/help_provider.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef HELPPROVIDER_H_INCLUDED #define HELPPROVIDER_H_INCLUDED diff --git a/shared/i18n.h b/shared/i18n.h index cac6555c..8aa38f3c 100644 --- a/shared/i18n.h +++ b/shared/i18n.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef I18_N_HEADER_3843489325045 #define I18_N_HEADER_3843489325045 diff --git a/shared/int64.h b/shared/int64.h index 15900fde..61ef1716 100644 --- a/shared/int64.h +++ b/shared/int64.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef FFS_LARGE_64_BIT_INTEGER_H_INCLUDED #define FFS_LARGE_64_BIT_INTEGER_H_INCLUDED diff --git a/shared/last_error.cpp b/shared/last_error.cpp index ea8345bc..57053c30 100644 --- a/shared/last_error.cpp +++ b/shared/last_error.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "last_error.h" #include "string_utf8.h" #include "i18n.h" diff --git a/shared/last_error.h b/shared/last_error.h index b617ebf5..3e90a1a0 100644 --- a/shared/last_error.h +++ b/shared/last_error.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef SYSTEMFUNCTIONS_H_INCLUDED #define SYSTEMFUNCTIONS_H_INCLUDED diff --git a/shared/localization.cpp b/shared/localization.cpp index 919009d6..66b2d97b 100644 --- a/shared/localization.cpp +++ b/shared/localization.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "localization.h" #include #include diff --git a/shared/localization.h b/shared/localization.h index 07ac2a69..438ad445 100644 --- a/shared/localization.h +++ b/shared/localization.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef MISC_H_INCLUDED #define MISC_H_INCLUDED diff --git a/shared/long_path_prefix.h b/shared/long_path_prefix.h index b6da9168..45fde0fa 100644 --- a/shared/long_path_prefix.h +++ b/shared/long_path_prefix.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef LONGPATHPREFIX_H_INCLUDED #define LONGPATHPREFIX_H_INCLUDED diff --git a/shared/mouse_move_dlg.cpp b/shared/mouse_move_dlg.cpp index 95074b55..7981df49 100644 --- a/shared/mouse_move_dlg.cpp +++ b/shared/mouse_move_dlg.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "mouse_move_dlg.h" #include #include //includes "windows.h" diff --git a/shared/mouse_move_dlg.h b/shared/mouse_move_dlg.h index 2e23c089..4412529c 100644 --- a/shared/mouse_move_dlg.h +++ b/shared/mouse_move_dlg.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef MOUSEMOVEWINDOW_H_INCLUDED #define MOUSEMOVEWINDOW_H_INCLUDED diff --git a/shared/notify_removal.cpp b/shared/notify_removal.cpp index 819604ad..3a9239db 100644 --- a/shared/notify_removal.cpp +++ b/shared/notify_removal.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "notify_removal.h" #include #include "last_error.h" @@ -183,8 +183,8 @@ public: } private: - Pimpl(Pimpl&); - Pimpl& operator=(Pimpl&); + Pimpl(Pimpl&); + Pimpl& operator=(Pimpl&); virtual void onMessage(UINT message, WPARAM wParam, LPARAM lParam) //throw()! { diff --git a/shared/notify_removal.h b/shared/notify_removal.h index abdf460b..f9d1cbaf 100644 --- a/shared/notify_removal.h +++ b/shared/notify_removal.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef NOTIFY_H_INCLUDED #define NOTIFY_H_INCLUDED diff --git a/shared/parse_lng.h b/shared/parse_lng.h index fcf20d28..b943d222 100644 --- a/shared/parse_lng.h +++ b/shared/parse_lng.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef PARSE_LNG_HEADER_INCLUDED #define PARSE_LNG_HEADER_INCLUDED diff --git a/shared/parse_plural.h b/shared/parse_plural.h index 3837feba..1139ffb6 100644 --- a/shared/parse_plural.h +++ b/shared/parse_plural.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef PARSE_PLURAL_H_INCLUDED #define PARSE_PLURAL_H_INCLUDED diff --git a/shared/parse_txt.h b/shared/parse_txt.h index 56147425..ca155dec 100644 --- a/shared/parse_txt.h +++ b/shared/parse_txt.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef PARSE_TXT_H_INCLUDED #define PARSE_TXT_H_INCLUDED diff --git a/shared/pch.h b/shared/pch.h index 06d6b417..aae74c08 100644 --- a/shared/pch.h +++ b/shared/pch.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef FFS_PRECOMPILED_HEADER #define FFS_PRECOMPILED_HEADER diff --git a/shared/perf.h b/shared/perf.h index f62f9cc0..9bcf7882 100644 --- a/shared/perf.h +++ b/shared/perf.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef DEBUG_PERF_HEADER #define DEBUG_PERF_HEADER diff --git a/shared/recycler.cpp b/shared/recycler.cpp index cc216d4f..92b7b222 100644 --- a/shared/recycler.cpp +++ b/shared/recycler.cpp @@ -3,13 +3,15 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "recycler.h" #include #include #include "i18n.h" +#include "file_handling.h" #ifdef FFS_WIN +#include #include "dll_loader.h" #include //includes "windows.h" #include "build_info.h" @@ -45,7 +47,6 @@ std::wstring getRecyclerDllName() bool vistaOrLater() { OSVERSIONINFO osvi = {}; - ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); //IFileOperation is supported with Vista and later @@ -72,12 +73,12 @@ Nevertheless, let's use IFileOperation for better error reporting! void moveToWindowsRecycler(const std::vector& filesToDelete) //throw (FileError) { - using zen::FileError; - if (filesToDelete.empty()) return; - static const bool useIFileOperation = vistaOrLater(); + static bool useIFileOperation = false; + static boost::once_flag once = BOOST_ONCE_INIT; //caveat: function scope static initialization is not thread-safe in VS 2010! + boost::call_once(once, []() { useIFileOperation = vistaOrLater(); }); if (useIFileOperation) //new recycle bin usage: available since Vista { @@ -86,14 +87,8 @@ void moveToWindowsRecycler(const std::vector& filesToDelete) //throw ( std::back_inserter(fileNames), std::mem_fun_ref(&Zstring::c_str)); using namespace fileop; - - static MoveToRecycleBinFct moveToRecycler = NULL; - if (!moveToRecycler) - moveToRecycler = util::getDllFun(getRecyclerDllName(), moveToRecycleBinFctName); - - static GetLastErrorFct getLastError = NULL; - if (!getLastError) - getLastError = util::getDllFun(getRecyclerDllName(), getLastErrorFctName); + MoveToRecycleBinFct moveToRecycler = util::getDllFun(getRecyclerDllName(), moveToRecycleBinFctName); + GetLastErrorFct getLastError = util::getDllFun (getRecyclerDllName(), getLastErrorFctName); if (moveToRecycler == NULL || getLastError == NULL) throw FileError(_("Error moving to Recycle Bin:") + "\n\"" + fileNames[0] + "\"" + //report first file only... better than nothing @@ -122,7 +117,7 @@ void moveToWindowsRecycler(const std::vector& filesToDelete) //throw ( //filenameDoubleNull += removeLongPathPrefix(*i); //::SHFileOperation() can't handle \\?\-prefix! //You should use fully-qualified path names with this function. Using it with relative path names is not thread safe. filenameDoubleNull += *i; //::SHFileOperation() can't handle \\?\-prefix! - filenameDoubleNull += Zchar(0); + filenameDoubleNull += L'\0'; } SHFILEOPSTRUCT fileOp = {}; @@ -137,7 +132,7 @@ void moveToWindowsRecycler(const std::vector& filesToDelete) //throw ( if (::SHFileOperation(&fileOp) != 0 || fileOp.fAnyOperationsAborted) { - throw FileError(_("Error moving to Recycle Bin:") + "\n\"" + filenameDoubleNull.c_str() + "\""); //report first file only... better than nothing + throw FileError(_("Error moving to Recycle Bin:") + "\n\"" + filenameDoubleNull + "\""); //report first file only... better than nothing } } } @@ -145,41 +140,48 @@ void moveToWindowsRecycler(const std::vector& filesToDelete) //throw ( } -bool zen::moveToRecycleBin(const Zstring& fileToDelete) //throw (FileError) +bool zen::moveToRecycleBin(const Zstring& filename) //throw (FileError) { -#ifdef FFS_WIN - const Zstring filenameFmt = applyLongPathPrefix(fileToDelete); - - const DWORD attr = ::GetFileAttributes(filenameFmt.c_str()); - if (attr == INVALID_FILE_ATTRIBUTES) + if (!somethingExists(filename)) return false; //neither file nor any other object with that name existing: no error situation, manual deletion relies on it! - //::SetFileAttributes(filenameFmt.c_str(), FILE_ATTRIBUTE_NORMAL); - //both SHFileOperation and useIFileOperation are not able to delete a folder named "System Volume Information" with normal attributes but shamelessly report success +#ifdef FFS_WIN + //::SetFileAttributes(applyLongPathPrefix(filename).c_str(), FILE_ATTRIBUTE_NORMAL); + //both SHFileOperation and IFileOperation are not able to delete a folder named "System Volume Information" with normal attributes but shamelessly report success std::vector fileNames; - fileNames.push_back(fileToDelete); + fileNames.push_back(filename); ::moveToWindowsRecycler(fileNames); //throw (FileError) #elif defined FFS_LINUX - struct stat fileInfo = {}; - if (::lstat(fileToDelete.c_str(), &fileInfo) != 0) - return false; //neither file nor any other object with that name existing: no error situation, manual deletion relies on it! - - Glib::RefPtr fileObj = Gio::File::create_for_path(fileToDelete.c_str()); //never fails + Glib::RefPtr fileObj = Gio::File::create_for_path(filename.c_str()); //never fails try { if (!fileObj->trash()) - throw FileError(_("Error moving to Recycle Bin:") + "\n\"" + fileToDelete + "\"" + + throw FileError(_("Error moving to Recycle Bin:") + "\n\"" + filename + "\"" + "\n\n" + "(unknown error)"); } catch (const Glib::Error& errorObj) { + //implement same behavior as in Windows: if recycler is not existing, delete permanently + if (errorObj.code() == G_IO_ERROR_NOT_SUPPORTED) + { + struct stat fileInfo = {}; + if (::lstat(filename.c_str(), &fileInfo) != 0) + return false; + + if (S_ISLNK(fileInfo.st_mode) || S_ISREG(fileInfo.st_mode)) + removeFile(filename); //throw FileError + else if (S_ISDIR(fileInfo.st_mode)) + removeDirectory(filename); //throw FileError + return true; + } + //assemble error message - const std::wstring errorMessage = L"Glib Error Code " + toString(errorObj.code()) + ", " + - g_quark_to_string(errorObj.domain()) + ": " + errorObj.what(); + const std::wstring errorMessage = L"Glib Error Code " + toString(errorObj.code()) + /* ", " + + g_quark_to_string(errorObj.domain()) + */ ": " + errorObj.what(); - throw FileError(_("Error moving to Recycle Bin:") + "\n\"" + fileToDelete + "\"" + + throw FileError(_("Error moving to Recycle Bin:") + "\n\"" + filename + "\"" + "\n\n" + "(" + errorMessage + ")"); } #endif @@ -188,15 +190,15 @@ bool zen::moveToRecycleBin(const Zstring& fileToDelete) //throw (FileError) #ifdef FFS_WIN -zen::StatusRecycler zen::recycleBinExists(const Zstring& pathName) +zen::StatusRecycler zen::recycleBinStatus(const Zstring& pathName) { std::vector buffer(MAX_PATH + 1); if (::GetVolumePathName(applyLongPathPrefix(pathName).c_str(), //__in LPCTSTR lpszFileName, &buffer[0], //__out LPTSTR lpszVolumePathName, static_cast(buffer.size()))) //__in DWORD cchBufferLength { - Zstring rootPath =&buffer[0]; - if (!rootPath.EndsWith(FILE_NAME_SEPARATOR)) //a trailing backslash is required + Zstring rootPath = &buffer[0]; + if (!endsWith(rootPath, FILE_NAME_SEPARATOR)) //a trailing backslash is required rootPath += FILE_NAME_SEPARATOR; SHQUERYRBINFO recInfo = {}; @@ -207,4 +209,22 @@ zen::StatusRecycler zen::recycleBinExists(const Zstring& pathName) } return STATUS_REC_UNKNOWN; } +#elif defined FFS_LINUX +/* +We really need access to a similar function to check whether a directory supports trashing and emit a warning if it does not! + +The following function looks perfect, alas it is restricted to local files and to the implementation of GIO only: + + gboolean _g_local_file_has_trash_dir(const char* dirname, dev_t dir_dev); + See: http://www.netmite.com/android/mydroid/2.0/external/bluetooth/glib/gio/glocalfileinfo.h + + Just checking for "G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH" is not correct, since we find in + http://www.netmite.com/android/mydroid/2.0/external/bluetooth/glib/gio/glocalfileinfo.c + + g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH, + writable && parent_info->has_trash_dir); + + => We're NOT interested in whether the specified folder can be trashed, but whether it supports thrashing its child elements! (Only support, not actual write access!) + This renders G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH useless for this purpose. +*/ #endif diff --git a/shared/recycler.h b/shared/recycler.h index da6e3123..718b64cc 100644 --- a/shared/recycler.h +++ b/shared/recycler.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef RECYCLER_H_INCLUDED #define RECYCLER_H_INCLUDED @@ -23,15 +23,12 @@ Recycler always available: during runtime either SHFileOperation or (since Vista Linux ----- -Include compilation flag: -`pkg-config --cflags gtkmm-2.4` - -Linker flag: -`pkg-config --libs gtkmm-2.4` +Compiler flag: `pkg-config --cflags gtkmm-2.4` +Linker flag: `pkg-config --libs gtkmm-2.4` */ -//move a file or folder to Recycle Bin -bool moveToRecycleBin(const Zstring& fileToDelete); //return "true" if file/dir was actually deleted; throw (FileError) +//move a file or folder to Recycle Bin (deletes permanently if recycle is not available) +bool moveToRecycleBin(const Zstring& filename); //return "true" if file/dir was actually deleted; throw (FileError) #ifdef FFS_WIN @@ -42,7 +39,7 @@ enum StatusRecycler STATUS_REC_UNKNOWN }; -StatusRecycler recycleBinExists(const Zstring& pathName); //test existence of Recycle Bin API for certain path +StatusRecycler recycleBinStatus(const Zstring& pathName); //test existence of Recycle Bin API for certain path #endif } diff --git a/shared/resolve_path.cpp b/shared/resolve_path.cpp index 19dc0011..a9d1e0e5 100644 --- a/shared/resolve_path.cpp +++ b/shared/resolve_path.cpp @@ -8,6 +8,9 @@ #include "dll_loader.h" #include //includes "windows.h" #include "long_path_prefix.h" +#ifdef _MSC_VER +#pragma comment(lib, "Mpr.lib") +#endif #elif defined FFS_LINUX #include @@ -21,20 +24,42 @@ using namespace zen; namespace { #ifdef FFS_WIN -Zstring resolveRelativePath(const Zstring& relativeName, DWORD proposedBufferSize = 1000) +Zstring resolveBrokenNetworkMap(const Zstring& dirname) //circumvent issue with disconnected network maps that could be activated by a simple explorer double click { - std::vector fullPath(proposedBufferSize); - - const DWORD rv = ::GetFullPathName( - applyLongPathPrefix(relativeName).c_str(), //__in LPCTSTR lpFileName, - proposedBufferSize, //__in DWORD nBufferLength, - &fullPath[0], //__out LPTSTR lpBuffer, - NULL); //__out LPTSTR *lpFilePart - if (rv == 0 || rv == proposedBufferSize) + if (dirname.size() >= 2 && iswalpha(dirname[0]) && dirname[1] == L':') + { + Zstring driveLetter(dirname.c_str(), 2); //e.g.: "Q:" + if (::GetFileAttributes((driveLetter + L'\\').c_str()) == INVALID_FILE_ATTRIBUTES) + { + DWORD bufferSize = 10000; + std::vector remoteNameBuffer(bufferSize); + DWORD rv = ::WNetGetConnection(driveLetter.c_str(), //__in LPCTSTR lpLocalName in the form ":" + &remoteNameBuffer[0], //__out LPTSTR lpRemoteName, + &bufferSize); //__inout LPDWORD lpnLength + (void)rv; + //no error check here! remoteNameBuffer will be filled on ERROR_CONNECTION_UNAVAIL and maybe others? + Zstring networkShare = &remoteNameBuffer[0]; + if (!networkShare.empty()) + return networkShare + (dirname.c_str() + 2); //replace "Q:\subdir" by "\\server\share\subdir" + } + } + return dirname; +} + + +Zstring resolveRelativePath(Zstring relativeName) +{ + relativeName = resolveBrokenNetworkMap(relativeName); + + std::vector fullPath(10000); + + const DWORD rv = ::GetFullPathName(applyLongPathPrefix(relativeName).c_str(), //__in LPCTSTR lpFileName, + static_cast(fullPath.size()), //__in DWORD nBufferLength, + &fullPath[0], //__out LPTSTR lpBuffer, + NULL); //__out LPTSTR *lpFilePart + if (rv == 0 || rv >= fullPath.size()) //theoretically, rv can never be == fullPath.size() //ERROR! Don't do anything return relativeName; - if (rv > proposedBufferSize) - return resolveRelativePath(relativeName, rv); return &fullPath[0]; } diff --git a/shared/resolve_path.h b/shared/resolve_path.h index 4ee1a90f..f6ae58cb 100644 --- a/shared/resolve_path.h +++ b/shared/resolve_path.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef RESOLVE_PATH_H_INCLUDED #define RESOLVE_PATH_H_INCLUDED diff --git a/shared/serialize.cpp b/shared/serialize.cpp index c2da1202..26102820 100644 --- a/shared/serialize.cpp +++ b/shared/serialize.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "serialize.h" #include "i18n.h" diff --git a/shared/serialize.h b/shared/serialize.h index 769b8671..c8a94ad1 100644 --- a/shared/serialize.h +++ b/shared/serialize.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef SERIALIZE_H_INCLUDED #define SERIALIZE_H_INCLUDED diff --git a/shared/shadow.cpp b/shared/shadow.cpp index 948050b6..f000a69b 100644 --- a/shared/shadow.cpp +++ b/shared/shadow.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "shadow.h" #include //includes "windows.h" #include "i18n.h" @@ -14,8 +14,8 @@ #include "ShadowCopy\shadow.h" #include "Loki/ScopeGuard.h" -using shadow::ShadowCopy; using namespace zen; +using namespace shadow; namespace @@ -23,7 +23,6 @@ namespace bool newerThanXP() { OSVERSIONINFO osvi = {}; - ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); if (::GetVersionEx(&osvi)) @@ -43,7 +42,7 @@ bool runningWOW64() //test if process is running under WOW64 (reference http://m HANDLE hProcess, PBOOL Wow64Process); - static const IsWow64ProcessFun isWow64Process = + const IsWow64ProcessFun isWow64Process = util::getDllFun(L"kernel32.dll", "IsWow64Process"); if (isWow64Process) @@ -87,13 +86,8 @@ public: ShadowVolume(const Zstring& volumeNameFormatted) : //throw(FileError) backupHandle(0) { - using namespace shadow; - - if (!createShadowCopy) - createShadowCopy = util::getDllFun(getShadowDllName(), createShadowCopyFctName); - - if (!releaseShadowCopy) - releaseShadowCopy = util::getDllFun(getShadowDllName(), releaseShadowCopyFctName); + createShadowCopy = util::getDllFun(getShadowDllName(), createShadowCopyFctName); + releaseShadowCopy = util::getDllFun(getShadowDllName(), releaseShadowCopyFctName); //check if shadow copy dll was loaded correctly if (createShadowCopy == NULL || @@ -103,8 +97,7 @@ public: //VSS does not support running under WOW64 except for Windows XP and Windows Server 2003 //(Reference: http://msdn.microsoft.com/en-us/library/aa384627(VS.85).aspx) - static const bool wow64Active = runningWOW64(); - if (wow64Active) + if (runningWOW64()) throw FileError(_("Error starting Volume Shadow Copy Service!") + "\n" + _("Making shadow copies on WOW64 is not supported. Please use FreeFileSync 64-bit version.")); @@ -140,24 +133,18 @@ private: ShadowVolume(const ShadowVolume&); ShadowVolume& operator=(const ShadowVolume&); - static shadow::CreateShadowCopyFct createShadowCopy; - static shadow::ReleaseShadowCopyFct releaseShadowCopy; + shadow::CreateShadowCopyFct createShadowCopy; + shadow::ReleaseShadowCopyFct releaseShadowCopy; Zstring shadowVol; ShadowHandle backupHandle; }; - - -shadow::CreateShadowCopyFct ShadowCopy::ShadowVolume::createShadowCopy; -shadow::ReleaseShadowCopyFct ShadowCopy::ShadowVolume::releaseShadowCopy; //############################################################################################################# Zstring ShadowCopy::makeShadowCopy(const Zstring& inputFile) { - using namespace zen; - wchar_t volumeNameRaw[1000]; if (!::GetVolumePathName(inputFile.c_str(), //__in LPCTSTR lpszFileName, diff --git a/shared/shadow.h b/shared/shadow.h index edea4377..aff5b437 100644 --- a/shared/shadow.h +++ b/shared/shadow.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef SHADOW_H_INCLUDED #define SHADOW_H_INCLUDED diff --git a/shared/shell_execute.h b/shared/shell_execute.h index 2cabbed1..64797eff 100644 --- a/shared/shell_execute.h +++ b/shared/shell_execute.h @@ -3,20 +3,20 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef EXECUTE_HEADER_23482134578134134 #define EXECUTE_HEADER_23482134578134134 -#include #include #ifdef FFS_WIN -#include "string_tools.h" #include "last_error.h" +#include "string_tools.h" #include "i18n.h" #include //includes "windows.h" #elif defined FFS_LINUX +#include #include #endif @@ -69,7 +69,7 @@ void shellExecute(const wxString& command, ExecutionType type = EXEC_TYPE_ASYNC) if (!::ShellExecuteEx(&execInfo)) //__inout LPSHELLEXECUTEINFO lpExecInfo { - wxString errorMsg = _("Invalid commandline: \"%x\""); + wxString errorMsg = _("Invalid commandline: %x"); wxString cmdFmt = wxString(L"\nFile: ") + filename + L"\nArg: " + arguments; errorMsg.Replace(L"%x", cmdFmt); @@ -87,10 +87,26 @@ void shellExecute(const wxString& command, ExecutionType type = EXEC_TYPE_ASYNC) } #elif defined FFS_LINUX - //by default wxExecute uses a zero sized dummy window as a hack to keep focus which leaves a useless empty icon in ALT-TAB list - //=> use wxEXEC_NODISABLE and roll our own window disabler! (see comment in app.cpp: void *wxGUIAppTraits::BeforeChildWaitLoop()) - wxWindowDisabler dummy; //disables all top level windows - wxExecute(command, (type == EXEC_TYPE_ASYNC ? wxEXEC_ASYNC : wxEXEC_SYNC) | wxEXEC_NODISABLE); + if (type == EXEC_TYPE_SYNC) + { + int rv = ::system(utf8CvrtTo(command).c_str()); //do NOT use std::system as its documentation says nothing about "WEXITSTATUS(rv)", ect... + if (rv == -1 || WEXITSTATUS(rv) == 127) //http://linux.die.net/man/3/system "In case /bin/sh could not be executed, the exit status will be that of a command that does exit(127)" + { + wxString errorMsg = _("Invalid commandline: %x"); + replace(errorMsg, L"%x", L"\n" + command); + wxMessageBox(errorMsg); + return; + } + } + else + { + // ! unfortunately it seems there is no way on Linux to get a failure notification for calling an invalid commandline asynchronously ! + + //by default wxExecute uses a zero sized dummy window as a hack to keep focus which leaves a useless empty icon in ALT-TAB list + //=> use wxEXEC_NODISABLE and roll our own window disabler! (see comment in app.cpp: void *wxGUIAppTraits::BeforeChildWaitLoop()) + wxWindowDisabler dummy; //disables all top level windows + wxExecute(command, wxEXEC_ASYNC | wxEXEC_NODISABLE); + } #endif } } diff --git a/shared/standard_paths.cpp b/shared/standard_paths.cpp index 928dedcc..c2d79516 100644 --- a/shared/standard_paths.cpp +++ b/shared/standard_paths.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "standard_paths.h" #include #include "string_conv.h" diff --git a/shared/standard_paths.h b/shared/standard_paths.h index faafe263..708a377d 100644 --- a/shared/standard_paths.h +++ b/shared/standard_paths.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef STANDARDPATHS_H_INCLUDED #define STANDARDPATHS_H_INCLUDED diff --git a/shared/string_conv.h b/shared/string_conv.h index 477dda8c..976080fb 100644 --- a/shared/string_conv.h +++ b/shared/string_conv.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef STRINGCONV_H_INCLUDED #define STRINGCONV_H_INCLUDED diff --git a/shared/symlink_target.h b/shared/symlink_target.h index e3a75f81..ef7b2275 100644 --- a/shared/symlink_target.h +++ b/shared/symlink_target.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef SYMLINK_WIN_H_INCLUDED #define SYMLINK_WIN_H_INCLUDED diff --git a/shared/taskbar.cpp b/shared/taskbar.cpp index 969f4bb0..005df705 100644 --- a/shared/taskbar.cpp +++ b/shared/taskbar.cpp @@ -5,16 +5,24 @@ // ************************************************************************** // #include "taskbar.h" + +#ifdef FFS_WIN #include "Taskbar_Seven/taskbar.h" #include "dll_loader.h" #include "build_info.h" #include "assert_static.h" #include //includes "windows.h" +#elif defined HAVE_UBUNTU_UNITY +#include +#endif + using namespace util; -using namespace tbseven; +#ifdef FFS_WIN +using namespace tbseven; + namespace { bool windows7TaskbarAvailable() @@ -45,7 +53,7 @@ std::wstring getTaskBarDllName() //######################################################################################################## -class TaskbarProgress::Pimpl //throw (TaskbarNotAvailable) +class Taskbar::Pimpl //throw (TaskbarNotAvailable) { public: Pimpl(const wxTopLevelWindow& window) : @@ -60,29 +68,26 @@ public: throw TaskbarNotAvailable(); } - ~Pimpl() - { - setStatus(STATUS_NOPROGRESS); - } + ~Pimpl() { setStatus(STATUS_NOPROGRESS); } void setStatus(Status status) { TaskBarStatus tbSevenStatus = tbseven::STATUS_NORMAL; switch (status) { - case TaskbarProgress::STATUS_NOPROGRESS: + case Taskbar::STATUS_NOPROGRESS: tbSevenStatus = tbseven::STATUS_NOPROGRESS; break; - case TaskbarProgress::STATUS_INDETERMINATE: + case Taskbar::STATUS_INDETERMINATE: tbSevenStatus = tbseven::STATUS_INDETERMINATE; break; - case TaskbarProgress::STATUS_NORMAL: + case Taskbar::STATUS_NORMAL: tbSevenStatus = tbseven::STATUS_NORMAL; break; - case TaskbarProgress::STATUS_ERROR: + case Taskbar::STATUS_ERROR: tbSevenStatus = tbseven::STATUS_ERROR; break; - case TaskbarProgress::STATUS_PAUSED: + case Taskbar::STATUS_PAUSED: tbSevenStatus = tbseven::STATUS_PAUSED; break; } @@ -96,23 +101,80 @@ public: } private: - void* assocWindow; + void* assocWindow; //HWND const SetStatusFct setStatus_; const SetProgressFct setProgress_; }; -//######################################################################################################## +#elif defined HAVE_UBUNTU_UNITY //Ubuntu unity +namespace +{ +const char FFS_DESKTOP_FILE[] = "freefilesync.desktop"; +} -TaskbarProgress::TaskbarProgress(const wxTopLevelWindow& window) : pimpl_(new Pimpl(window)) {} +class Taskbar::Pimpl //throw (TaskbarNotAvailable) +{ +public: + Pimpl(const wxTopLevelWindow& window) : + tbEntry(unity_launcher_entry_get_for_desktop_id(FFS_DESKTOP_FILE)) + //tbEntry(unity_launcher_entry_get_for_app_uri("application://freefilesync.desktop")) + { + if (!tbEntry) + throw TaskbarNotAvailable(); + } -TaskbarProgress::~TaskbarProgress() {} //std::unique_ptr ... + ~Pimpl() { setStatus(STATUS_NOPROGRESS); } //it seems UnityLauncherEntry* does not need destruction -void TaskbarProgress::setStatus(Status status) -{ - pimpl_->setStatus(status); -} + void setStatus(Status status) + { + switch (status) + { + case Taskbar::STATUS_ERROR: + unity_launcher_entry_set_urgent(tbEntry, true); + break; -void TaskbarProgress::setProgress(size_t current, size_t total) + case Taskbar::STATUS_NOPROGRESS: + case Taskbar::STATUS_INDETERMINATE: + unity_launcher_entry_set_urgent(tbEntry, false); + unity_launcher_entry_set_progress_visible(tbEntry, false); + break; + + case Taskbar::STATUS_NORMAL: + unity_launcher_entry_set_urgent(tbEntry, false); + unity_launcher_entry_set_progress_visible(tbEntry, true); + break; + + case Taskbar::STATUS_PAUSED: + unity_launcher_entry_set_urgent (tbEntry, false); + break; + } + } + + void setProgress(size_t current, size_t total) + { + unity_launcher_entry_set_progress(tbEntry, total == 0 ? 0 : double(current) / total); + } + +private: + UnityLauncherEntry* tbEntry; +}; + + +#else //no taskbar support yet +class Taskbar::Pimpl { - pimpl_->setProgress(current, total); -} +public: + Pimpl(const wxTopLevelWindow& window) { throw TaskbarNotAvailable(); } + void setStatus(Status status) {} + void setProgress(size_t current, size_t total) {} + +}; +#endif + + +//######################################################################################################## +Taskbar::Taskbar(const wxTopLevelWindow& window) : pimpl_(new Pimpl(window)) {} //throw TaskbarNotAvailable +Taskbar::~Taskbar() {} //std::unique_ptr ... + +void Taskbar::setStatus(Status status) { pimpl_->setStatus(status); } +void Taskbar::setProgress(size_t current, size_t total) { pimpl_->setProgress(current, total); } diff --git a/shared/taskbar.h b/shared/taskbar.h index 90a76d13..54e0a431 100644 --- a/shared/taskbar.h +++ b/shared/taskbar.h @@ -3,28 +3,32 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef TASKBARPROGRESS_H_INCLUDED #define TASKBARPROGRESS_H_INCLUDED -#ifndef FFS_WIN -use in windows build only! -#endif - #include #include +/* +Windows 7; show progress in windows superbar via ITaskbarList3 Interface (http://msdn.microsoft.com/en-us/library/dd391692(VS.85).aspx) + +Ubuntu: use Unity interface (optional) + +Define HAVE_UBUNTU_UNITY and set: + Compiler flag: `pkg-config --cflags unity` + Linker flag: `pkg-config --libs unity` +*/ namespace util { class TaskbarNotAvailable {}; -//show progress in windows superbar via ITaskbarList3 Interface (http://msdn.microsoft.com/en-us/library/dd391692(VS.85).aspx) -class TaskbarProgress +class Taskbar { public: - TaskbarProgress(const wxTopLevelWindow& window); //throw TaskbarNotAvailable() - ~TaskbarProgress(); + Taskbar(const wxTopLevelWindow& window); //throw TaskbarNotAvailable() + ~Taskbar(); enum Status { diff --git a/shared/toggle_button.cpp b/shared/toggle_button.cpp index 511822b1..24f74bc7 100644 --- a/shared/toggle_button.cpp +++ b/shared/toggle_button.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "toggle_button.h" void ToggleButton::init(const wxBitmap& activeBmp, diff --git a/shared/toggle_button.h b/shared/toggle_button.h index 6613fdd4..f333ca24 100644 --- a/shared/toggle_button.h +++ b/shared/toggle_button.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef TOGGLEBUTTON_H_INCLUDED #define TOGGLEBUTTON_H_INCLUDED diff --git a/shared/util.cpp b/shared/util.cpp index faa4074c..d780d683 100644 --- a/shared/util.cpp +++ b/shared/util.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "util.h" #include "zstring.h" #include "i18n.h" diff --git a/shared/util.h b/shared/util.h index 25762ce7..0e08280e 100644 --- a/shared/util.h +++ b/shared/util.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef UTIL_H_INCLUDED #define UTIL_H_INCLUDED diff --git a/shared/warn_static.h b/shared/warn_static.h new file mode 100644 index 00000000..bb4f4a6f --- /dev/null +++ b/shared/warn_static.h @@ -0,0 +1,35 @@ +// ************************************************************************** +// * This file is part of the zenXML project. It is distributed under the * +// * Boost Software License, Version 1.0. See accompanying file * +// * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt. * +// * Copyright (C) 2011 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** + +#ifndef WARN_STATIC_HEADER_08724567834560832745 +#define WARN_STATIC_HEADER_08724567834560832745 + +/* +Portable Compile-Time Warning +----------------------------- +Usage: + warn_static("my message") +*/ + +#ifdef _MSC_VER +#define MAKE_STRING_SUB(NUM) #NUM +#define MAKE_STRING(NUM) MAKE_STRING_SUB(NUM) + +#define warn_static(TXT) \ +__pragma(message (__FILE__ "(" MAKE_STRING(__LINE__) "): Warning: " ## TXT)) + +#elif defined __GNUC__ +#define LOKI_CONCAT( X, Y ) LOKI_CONCAT_SUB( X, Y ) +#define LOKI_CONCAT_SUB( X, Y ) X##Y + +#define warn_static(TXT) \ +typedef int STATIC_WARNING __attribute__ ((deprecated)); \ +enum { LOKI_CONCAT(warn_static_dummy_value, __LINE__) = sizeof(STATIC_WARNING) }; +#endif + + +#endif //WARN_STATIC_HEADER_08724567834560832745 \ No newline at end of file diff --git a/shared/wx_choice_enum.h b/shared/wx_choice_enum.h index 9f832394..e8fbeead 100644 --- a/shared/wx_choice_enum.h +++ b/shared/wx_choice_enum.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef WX_CHOICE_ENUM_H_INCLUDED #define WX_CHOICE_ENUM_H_INCLUDED diff --git a/shared/wx_timespan.h b/shared/wx_timespan.h index 108327bf..2e566927 100644 --- a/shared/wx_timespan.h +++ b/shared/wx_timespan.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef WX_TIMESPAN_CTRL_HEADER_INCLUDED #define WX_TIMESPAN_CTRL_HEADER_INCLUDED diff --git a/shared/xml_base.cpp b/shared/xml_base.cpp index cd9f58a6..c7c92401 100644 --- a/shared/xml_base.cpp +++ b/shared/xml_base.cpp @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "xml_base.h" #include #include @@ -13,12 +13,14 @@ using namespace zen; +//loadXmlDocument vs loadStream: +//1. better error reporting +//2. quick exit if (potentially large) input file is not an XML void xmlAccess::loadXmlDocument(const wxString& filename, XmlDoc& doc) //throw FfsXmlError() { std::string stream; try { - const zen::UInt64 fs = zen::getFilesize(toZ(filename)); //throw (FileError) { //quick test whether input is an XML: avoid loading large binary files up front! //doesn't correctly handle BOM! (but no issue yet...) @@ -31,6 +33,7 @@ void xmlAccess::loadXmlDocument(const wxString& filename, XmlDoc& doc) //throw F throw FfsXmlError(wxString(_("Error parsing configuration file:")) + wxT("\n\"") + filename + wxT("\"")); } + const zen::UInt64 fs = zen::getFilesize(toZ(filename)); //throw (FileError) stream.resize(to(fs)); FileInput inputFile(toZ(filename)); //throw (FileError); diff --git a/shared/xml_base.h b/shared/xml_base.h index 6a47fcf2..37d79863 100644 --- a/shared/xml_base.h +++ b/shared/xml_base.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef XMLBASE_H_INCLUDED #define XMLBASE_H_INCLUDED diff --git a/shared/xml_error.h b/shared/xml_error.h index ffd6af8b..6e17670a 100644 --- a/shared/xml_error.h +++ b/shared/xml_error.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef XMLERROR_H_INCLUDED #define XMLERROR_H_INCLUDED diff --git a/shared/zbase.h b/shared/zbase.h index 6d9ac578..55bc0d96 100644 --- a/shared/zbase.h +++ b/shared/zbase.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef Z_BASE_H_INCLUDED #define Z_BASE_H_INCLUDED @@ -12,6 +12,7 @@ #include #include #include +#include /* Allocator Policy: @@ -101,24 +102,17 @@ private: size_t capacity; //allocated size without null-termination }; - static Descriptor* descr(T* ptr) - { - return reinterpret_cast(ptr) - 1; - } - - static const Descriptor* descr(const T* ptr) - { - return reinterpret_cast(ptr) - 1; - } + static Descriptor* descr( T* ptr) { return reinterpret_cast< Descriptor*>(ptr) - 1; } + static const Descriptor* descr(const T* ptr) { return reinterpret_cast(ptr) - 1; } }; template //Allocator Policy -class StorageRefCount : public AP +class StorageRefCountThreadSafe : public AP { protected: - ~StorageRefCount() {} + ~StorageRefCountThreadSafe() {} static T* create(size_t size) { @@ -132,10 +126,7 @@ protected: assert(minCapacity >= size); Descriptor* const newDescr = static_cast(AP::allocate(sizeof(Descriptor) + (newCapacity + 1) * sizeof(T))); - - newDescr->refCount = 1; - newDescr->length = size; - newDescr->capacity = newCapacity; + new (newDescr) Descriptor(1, size, newCapacity); return reinterpret_cast(newDescr + 1); } @@ -150,7 +141,10 @@ protected: static void destroy(T* ptr) { if (--descr(ptr)->refCount == 0) + { + descr(ptr)->~Descriptor(); AP::deallocate(descr(ptr)); + } } static bool canWrite(const T* ptr, size_t minCapacity) //needs to be checked before writing to "ptr" @@ -173,26 +167,23 @@ protected: private: struct Descriptor { - size_t refCount; + Descriptor(long rc, size_t len, size_t cap) : refCount(rc), length(len), capacity(cap) {} + + boost::detail::atomic_count refCount; //practically no perf loss: ~0.2%! (FFS comparison) size_t length; size_t capacity; //allocated size without null-termination }; - static Descriptor* descr(T* ptr) - { - return reinterpret_cast(ptr) - 1; - } - - static const Descriptor* descr(const T* ptr) - { - return reinterpret_cast(ptr) - 1; - } + static Descriptor* descr( T* ptr) { return reinterpret_cast< Descriptor*>(ptr) - 1; } + static const Descriptor* descr(const T* ptr) { return reinterpret_cast(ptr) - 1; } }; -template class SP = StorageRefCount, //Storage Policy - class AP = AllocatorOptimalSpeed> //Allocator Policy +//perf note: interstingly StorageDeepCopy and StorageRefCountThreadSafe show same performance in FFS comparison + +template class SP = StorageRefCountThreadSafe, //Storage Policy + class AP = AllocatorOptimalSpeed> //Allocator Policy class Zbase : public SP { public: @@ -200,6 +191,7 @@ public: Zbase(const T* source); //implicit conversion from a C-string Zbase(const T* source, size_t length); Zbase(const Zbase& source); + Zbase(Zbase&& tmp); explicit Zbase(T source); //dangerous if implicit: T buffer[]; Zbase name = buffer; ups... //allow explicit construction from different string type, prevent ambiguity via SFINAE template explicit Zbase(const S& other, typename S::value_type = 0); @@ -261,6 +253,7 @@ public: void push_back(T val); //STL access Zbase& operator=(const Zbase& source); + Zbase& operator=(Zbase&& tmp); Zbase& operator=(const T* source); Zbase& operator=(T source); Zbase& operator+=(const Zbase& other); @@ -379,6 +372,14 @@ Zbase::Zbase(const Zbase& source) } +template class SP, class AP> +inline +Zbase::Zbase(Zbase&& tmp) +{ + rawStr = this->clone(tmp.rawStr); //for a ref-counting string there probably isn't a faster way, even with r-value references +} + + template class SP, class AP> template inline @@ -825,6 +826,15 @@ Zbase& Zbase::operator=(const Zbase& source) } +template class SP, class AP> +inline +Zbase& Zbase::operator=(Zbase&& tmp) +{ + swap(tmp); + return *this; +} + + template class SP, class AP> inline Zbase& Zbase::operator=(const T* source) diff --git a/shared/zstring.cpp b/shared/zstring.cpp index 2955ec3e..e1df17ee 100644 --- a/shared/zstring.cpp +++ b/shared/zstring.cpp @@ -3,9 +3,10 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #include "zstring.h" #include +#include #ifdef FFS_WIN #include //includes "windows.h" @@ -52,6 +53,12 @@ LeakChecker& LeakChecker::instance() return inst; } +//caveat: function scope static initialization is not thread-safe in VS 2010! => make sure to call at app start! +namespace +{ +struct Dummy { Dummy() { LeakChecker::instance(); }} blah; +} + std::string LeakChecker::rawMemToString(const void* ptr, size_t size) { @@ -113,7 +120,10 @@ int z_impl::compareFilenamesWin(const wchar_t* a, const wchar_t* b, size_t sizeA LPCWSTR lpString2, int cchCount2, BOOL bIgnoreCase); - static const CompareStringOrdinalFunc ordinalCompare = util::getDllFun(L"kernel32.dll", "CompareStringOrdinal"); + static CompareStringOrdinalFunc ordinalCompare = NULL; //caveat: function scope static initialization is not thread-safe in VS 2010! + static boost::once_flag once = BOOST_ONCE_INIT; + boost::call_once(once, []() { ordinalCompare = util::getDllFun(L"kernel32.dll", "CompareStringOrdinal"); }); + if (ordinalCompare != NULL) //this additional test has no noticeable performance impact { diff --git a/shared/zstring.h b/shared/zstring.h index 841fb8a2..3b4837db 100644 --- a/shared/zstring.h +++ b/shared/zstring.h @@ -3,7 +3,7 @@ // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** -// + #ifndef ZSTRING_H_INCLUDED #define ZSTRING_H_INCLUDED @@ -11,8 +11,8 @@ #include //strcmp() #ifndef NDEBUG +#include "boost_thread_wrap.h" //include #include -#include #endif @@ -22,7 +22,7 @@ class LeakChecker //small test for memory leaks public: void insert(const void* ptr, size_t size) { - wxCriticalSectionLocker dummy(lockActStrings); + boost::lock_guard dummy(lockActStrings); if (activeStrings.find(ptr) != activeStrings.end()) reportProblem(std::string("Fatal Error: New memory points into occupied space: ") + rawMemToString(ptr, size)); @@ -31,8 +31,7 @@ public: void remove(const void* ptr) { - wxCriticalSectionLocker dummy(lockActStrings); - + boost::lock_guard dummy(lockActStrings); if (activeStrings.find(ptr) == activeStrings.end()) reportProblem(std::string("Fatal Error: No memory available for deallocation at this location!")); @@ -50,7 +49,7 @@ private: static std::string rawMemToString(const void* ptr, size_t size); void reportProblem(const std::string& message); //throw (std::logic_error) - wxCriticalSection lockActStrings; + boost::mutex lockActStrings; typedef std::map VoidPtrSizeMap; VoidPtrSizeMap activeStrings; }; @@ -106,7 +105,6 @@ template