• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • Synchronization
      • Services
        • Overview
        • Synchronization Connection String
        • CSWeb
        • Bluetooth
        • Dropbox
        • FTP
        • Local Files
        • Syncable Name
      • Messages
    • CSPro Statements and Functions
    • Text Templates
    • Templated Reporting System
    • HTML, Markdown, and JavaScript Integration
    • Action Invoker
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataManager>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

Local Files Synchronization Service

Overview
The Local Files synchronization service simulates CSPro's file-based synchronization services, Dropbox and FTP. This service uses files stored on a local machine rather than accessing the files over the Internet. It is useful for:
  • Synchronizing with Dropbox files when the client software is installed on a Windows machine.
  • Synchronizing with an FTP server hosted on a local machine.
  • Testing synchronization operations.
Synchronizing with Local Files is particularly helpful when working with large quantities of data that would take a long time to transfer via requests over the Internet (to Dropbox or to an FTP server).
Local Files Connection
A connection to Local Files occurs as a result of a syncconnect function call, or as part of a CSPro operation such as a Simple Synchronization or an application deployment.
The resource of a Local Files connection string is the directory where the synchronization files are located. If can be specified as an absolute path specified as a file URI, or simply as a path, in which case it will be evaluated relative to the running application.
These are options that can be specified in the connection string. Note that values must be properly encoded based on the way that the connection string is defined (as a string, as a JSON object, or as a CSPro URI). The default behavior is marked with ⁺⁺⁺.
Property Name and ValuesDescription
 
"createDirectory"Determines whether the Local Files directory will be created if it does not exist.
false ⁺⁺⁺
An error occurs if the directory does not exist.
true
The directory is created if necessary.
The following are examples of how to create connections to Local Files:
// -------
// connect to the Dropbox directory mapped to:
// C:\surveys\dropbox
// -------

   
// shown using a file URI
    syncconnect("file:///C:/surveys/dropbox");

   
// shown using an absolute path
    syncconnect(@"C:\surveys\dropbox");

// -------
// connect to the FTP server hosted locally at:
// C:\surveys\ftp-server
// -------

   
// shown using a file URI
    syncconnect("file:///C:/surveys/ftp-server");

   
// shown using an absolute path
    syncconnect(@"C:\surveys\ftp-server");

// -------
// connect to a directory for testing sync operations,
// creating the directory if necessary
// -------

   
// shown using a path evaluated relative to the running application
    syncconnect("Sync-Tests|createDirectory=true");
Local Dropbox Connection
If connecting to a Dropbox directory, you can use the resource "Dropbox" with the property "useLocal" to have CSPro automatically identify the Dropbox directory. Using that process might result in a connection like:
// connect to the Dropbox directory using the client software
syncconnect("Dropbox|useLocal=true");
Synchronization Data Storage
Once CSPro connects to a file-based synchronization service, it looks for or creates a directory named CSPro in the root directory, using it for the results of synchronization operations. CSPro uses the following directories:
DirectoryDescription
/Files accessed using syncfile are evaluated from the root directory, not the CSPro directory.
 
/CSPro/apps/Applications deployed and used in operations such as syncapp or while updating applications.
 
/CSPro/DataSync/Case data uploaded using syncdata, and the dictionary describing it, are stored in subdirectories named using the dictionary's syncable name. For example: /CSPro/DataSync/LFS2026_DICT/data/ and /CSPro/DataSync/LFS2026_DICT/dict/.
 
/CSPro/messages/Messages sent using syncmessage or Sync.sendMessage.
 
/CSPro/paradata/Paradata logs uploaded using syncparadata or Sync.syncParadata.
See also: Synchronization Services, Dropbox Synchronization Service, FTP Synchronization Service