native.getSync()

Type Function
Library native.*
Return value Boolean and String
Revision Release 2022.3683
Keywords sync, icloud, backup, documents
See also native.setSync()

Overview

Gets the iCloud automatic backup settings for files in the system.DocumentsDirectory and system.ApplicationSupportDirectory on macOS and iOS systems.

The iCloud backup is true by default and must be set false with the native.setSync() API to disable automatic backup of files to iCloud.

This function returns up to two values:

Gotchas

This function is for macOS and iOS platforms only.

Syntax

native.getSync( filename, params )
filename (required)

String. Name of file (including path).

params (required)

Table. Table with the structure { key = "iCloudBackup" }.

Examples

-- Assumes that a file named 'SavedData.txt' is in 'system.DocumentsDirectory'

local results, errStr = native.getSync( "SavedData.dat", { key = "iCloudBackup" } ) 
-- Assumes that a file named 'SavedData.txt' is in a 'data' subdirectory of 'system.DocumentsDirectory'

local results, errStr = native.getSync( "data/SavedData.dat", { key = "iCloudBackup" } )