Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.0   6.1   6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3    Statistic  

Folders.SystemTemporary

Queries temporary folder.

Component: Folders
Version: 4.3
Mac OS X: Yes
Windows: Yes
Server: Yes
FileMaker Cloud: No

MBS( "Folders.SystemTemporary" )

Parameters

none

Result

Returns path or error.

Description

Queries temporary folder.
This is a native path. You can use Path.NativePathToFileMakerPath if you need to use path in a script step.

On Mac Folders.UserTemporary is in the user's home folder while the system wide temporary folder is in /var/folders and can be queried with Folders.SystemTemporary.

Examples

Queries path:

MBS( "Folders.SystemTemporary" )

Write container to temp file and launch:

# get temp folder
Set Variable [$TempFolder; Value:MBS( "Folders.SystemTemporary" )]
# and file name from container
Set Variable [$name; Value:MBS( "Path.LastPathComponent"; test::myContainer )]
# add name to folder path
Set Variable [$TempPath; Value:MBS( "Path.AddPathComponent"; $TempFolder; $name )]
# now write temp file
Set Variable [$r; Value:MBS( "Files.WriteFile"; test::myContainer; $TempPath)]
# and launch file
Set Variable [$r; Value:MBS( "Files.LaunchFile"; $TempPath)]

Download URL to temp file:

Set Variable [$curl; Value:MBS("CURL.New")]
#this is URL to download
Set Variable [$url; Value:"http://www.monkeybreadsoftware.de/filemaker/test.txt"]
#get file name from URL
Set Variable [$name; Value:MBS( "Path.LastPathComponent"; $URL )]
#now make temp file path
Set Variable [$path; Value:MBS( "Path.AddPathComponent"; MBS( "Folders.SystemTemporary" ); $name )]
#set URL to download
Set Variable [$r; Value:MBS("CURL.SetOptionURL"; $curl; "http://www.monkeybreadsoftware.de/filemaker/test.txt")]
#open destination file
Set Variable [$r; Value:MBS("CURL.CreateOutputFile"; $curl; $path)]
#run transfer
Set Field [CURL Test::Result; MBS("CURL.Perform"; $curl)]
#close destination file
Set Variable [$r; Value:MBS("CURL.CloseOutputFile"; $curl)]
#get debug messages
Set Field [CURL Test::debug; MBS("CURL.GetDebugAsText"; $curl)]
Set Variable [$result; Value:MBS("CURL.Cleanup"; $curl)]

See also


Folders.SystemFonts   -   Folders.UserDesktop

Feedback: Report problem or ask question.




Links
MBS Xojo Plugins