iCloud.docRead()

Type Function
Return value none
Revision 2017.3060
Keywords iCloud, sync, storage, document, docRead
See also iCloud.docWrite()
iCloudDocEvent
iCloud.*

Overview

Reads contents of specified file and invokes the onComplete listener function with an iCloudDocEvent upon completion.

Syntax

iCloud.docRead( params )
params (required)

Table. Table containing method-specific parameters — see the next section for details.

Parameter Reference

Valid keys for the params table include:

Example

local function docListener( event )

    if not event.isError then
        print( event.contents )  -- Contents of document file (retrieved data)
    else
        print( event.error )
        print( event.errorCode )
    end
end

iCloud.docRead(
    {
        filename = "test.txt",
        onComplete = docListener
    }
)