Configuring Advanced Directory Transfers

This page explains various settings of the advanced directory transfers between Windows and Linux machines. We will provide detailed examples for each of the settings below.

Overview

Each directory transfer command can synchronize one Windows directory (including arbitrary subdirectories) with one Linux directory. The synchronization can be performed in either direction and can include arbitrary subdirectories:

Selecting Directories

The Windows and Linux directories, and also the transfer direction can be specified using the upper part of the transfer configuration GUI:

  1. The Windows directory must be an absolute path on the Windows machine. To avoid hardcoding user-specific paths, variables like $(ProjectDir) and VisualGDB will automatically expand them.
  2. The direction button allows choosing between incoming (Linux-to-Windows) and outgoing (Windows-to-Linux) transfers. Click it to toggle the transfer direction.
  3. The Linux directory must also be an absolute path and can also use the variables like $(ProjectDir).

Choosing which files and subdirectories to transfer (simple view)

When you define a new directory transfer command, it always starts with the simple view. This mode allows specifying the file masks and subdirectories that will be transferred:

  1. File Masks: specifies the masks for the files that will be transferred:
    • The masks are applied to file name only (not the path including the directory).
    •  '*' corresponds to any number of any symbols; '?' corresponds to a single occurence of any symbol.
    • You can exclude a certain mask by prepending '-' to it. The masks will be evaluated in the order they were defined.
    Below are a few examples of file masks:
    Masks main.cpp MainTests.cpp main.c
    *.cpp  
    -*Tests.*;*.cpp    
    *.cpp;-*Tests.*  
    *.c    
    *.c*
  2. Subdirectories: controls which subdirectories will be transferred:
    • All will transfer the files from the specified directory and all subdirectories
    • None will only transfer the files from the specified directory
    • Specified below will allow choosing the specific subdirectories to transfer
  3. Specific subdirectories: allows specifying which subdirectories to transfer. Use the "edit" button to edit the values interactively. If you prefer editing the values manually, note the following syntax:
    • * refers to the root directory
    • DirectoryName\* will synchronize only the files in a directory, but not from subdirectories
    • DirectoryName will synchronize files from the specified directory and all subdirectories
  4. Apply exception list (outgoing transfers only): if enabled, VisualGDB will automatically append the exception lists defined via Tools->Options->VisualGDB->Common->SSH to the file/folder filters.

You can define advanced rules (e.g. exclude the .svn directory everywhere) using the advanced view. Click "Wwitch to advanced view" near the "Help" link to activate the advanced view.

Choosing which files and subdirectories to transfer (advanced view)

The advanced view allows defining 2 sets of regular expressions: one set is applied to the file names, the other one is applied to relative paths. We will provide detailed examples below:

  1. File regexes: specifies regular expressions that will be applied to the file names:
    • Each regular expression must explicitly include the start (^) and end ($) markers unless it starts/ends with .*
    • Escape the dot symbol (\.) as "." corresponds to "any symbol"
    • Prepend "-" to the regular expression to exclude the files matching it.
    • The regular expressions will be checked in the order they are defined.
    Below are a few examples of the regular expressions for file names:
    Regular expressions main.cpp MainTests.cpp main.c main.cxx maincpp.h
    ^.*\.cpp$      
    ^.*\.c(|pp)$        
    -^.*Tests.*$;^.*\.c.*$      
    ^.*.cpp$    
  2. Subdirectory regexes: specifies the regular expression that will be applied to the subdirectory names:
    • Each time when entering a subdirectory, VisualGDB will check its relative path using forward slashes (e.g. dir/subdir) against regexes. If it doesn't match, the directory (and all subdirectories) will be skipped.
    • Before listing files in a directory, VisualGDB will check if the <directory>/. path matches the regexes (e.g. . for the root directory, or dir/subdir/.). If this path doesn't match, VisualGDB will skip files in the directory, but will continue checking the subdirectories.
    • In order for a directory to be included, its relative path and the relative paths of each parent level must match the specified regexes. Otherwise, the file directory will stop the first time a parent level doesn't match the regexes.
    Below are a few examples of the regular expressions for subdirectories:
    Regular expressions file.cpp dir/file.cpp dir/subdir/file.cpp .svn/file.cpp dir/.svn/file.cpp dir2/file.cpp
    .*
    ^\.$
    ^dir$
    ^dir(|/\.)$
    ^dir(|/.*)$
    ^dir.*$
    -(^|.*/)\.svn$;.*
    ^dir/subdir($|/.*)
    ^dir$;^dir/subdir($|/.*)

The advanced view involves regular expressions with complex semantics and is intended for scenarios where the simple view does not provide enough flexibility. For less complex setups, click "Switch to simple view" to get back to the file mask/subdirectory list view.

Retransfer Settings

VisualGDB allows specifying what exact files will be retransferred each time the synchronization happens. The following options are available:

  1. Retransfer files: specifies which files will be transferred each time:
    • All will retransfer all files at each synchronization, regardless their modification status.
    • Missing on target will retransfer the files that are missing in the target folder and will skip files that already exist, even if their timestamp/sizes don't match.
    • Different from target will retransfer files that are missing in the target folder, or have a mismatching size/timestamp. The actual file contents is not checked.
    • Changed since last upload (outgoing transfers only) will retransfer the files that were changed since the last transfer time. VisualGDB will not query the actual file list from the remote target and will instead keep a local record of the transferred files and will check the files against it. This is faster than comparing the sizes/timestamps with the target, but won't handle the cases when the files are edited on the Linux side.
  2. Delete the files removed from source directory: will delete the files in the target directory (Windows for incoming transfers; Linux for outgoing transfers) that were deleted in the source directory:
    • When using "changed since last upload "mode, VisualGDB will delete files that were uploaded last time and no longer available. Files added on the target side won't be deleted.
    • When using other retransfer modes, every file matches the file/folder constraints and is not present in the source directory, will be deleted on the target.