Save to and retrieve from Directory

the code works on iPhone… How do I make it work on Mac desktop ?

I can’t find system.TemporaryDirectory equivalent…

if platformType==“Mac OS X” then

    path=system.pathForFile( “ContractView.pdf”, system.TemporaryDirectory )

    else

    path = system.pathForFile( “ContractView.pdf”, system.DocumentsDirectory )

    end

    

    local file = io.open( path, “w” )

    file:write( thePdf )

    

    io.close( file )

    file = nil

It appears to be:

/Users/YOURHOMEFOLDER/Library/Application Support/YOURAPPNAME/tmp

system.DocumentsDirectory is in:

/Users/YOURHOMEFOLDER/Library/Application Support/YOURAPPNAME/Documents

Rob

Thanks Rob…

One way to get a definitive answer is to simply print the value of “path”:

print("path: ", path)

Which gets you:

Jul 27 12:31:45.679: testapp-tmpdir: path: /Users/username/Library/Application Support/testapp-tmpdir/tmp/ContractView.pdf

It appears to be:

/Users/YOURHOMEFOLDER/Library/Application Support/YOURAPPNAME/tmp

system.DocumentsDirectory is in:

/Users/YOURHOMEFOLDER/Library/Application Support/YOURAPPNAME/Documents

Rob

Thanks Rob…

One way to get a definitive answer is to simply print the value of “path”:

print("path: ", path)

Which gets you:

Jul 27 12:31:45.679: testapp-tmpdir: path: /Users/username/Library/Application Support/testapp-tmpdir/tmp/ContractView.pdf