Folders.SystemTemporary
-----------------------

Queries temporary folder.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Folders](component_Folders.md) | [4.3](newinversion43.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Folders.SystemTemporary" ) ### Parameters

none

### Result

Returns path or error.

### Description

Queries temporary folder.  
This is a native path. You can use [Path.NativePathToFileMakerPath](PathNativePathToFileMakerPath.md) if you need to use path in a script step.  
  
On Mac [Folders.UserTemporary](FoldersUserTemporary.md) 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](PathLastPathComponent.md)"; test::myContainer )\]  
\# add name to folder path   
Set Variable \[$TempPath ; Value:MBS ( "[Path.AddPathComponent](PathAddPathComponent.md)"; $TempFolder ; $name )\]  
\# now write temp file   
Set Variable \[$r ; Value:MBS ( "[Files.WriteFile](FilesWriteFile.md)"; test::myContainer ; $TempPath )\]  
\# and launch file   
Set Variable \[$r ; Value:MBS ( "[Files.LaunchFile](FilesLaunchFile.md)"; $TempPath )\]  
Download URL to temp file:

 Set Variable \[$curl ; Value:MBS ("[CURL.New](CURLNew.md)")\]  
\#this is URL to download   
Set Variable \[$url ; Value:"https://www.monkeybreadsoftware.com/filemaker/test.txt"\]  
\#get file name from URL   
Set Variable \[$name ; Value:MBS ( "[Path.LastPathComponent](PathLastPathComponent.md)"; $URL )\]  
\#now make temp file path   
Set Variable \[$path ; Value:MBS ( "[Path.AddPathComponent](PathAddPathComponent.md)"; MBS ( "Folders.SystemTemporary" ); $name )\]  
\#set URL to download   
Set Variable \[$r ; Value:MBS ("[CURL.SetOptionURL](CURLSetOptionURL.md)"; $curl ; "https://www.monkeybreadsoftware.com/filemaker/test.txt")\]  
\#open destination file   
Set Variable \[$r ; Value:MBS ("[CURL.CreateOutputFile](CURLCreateOutputFile.md)"; $curl ; $path )\]  
\#run transfer   
Set Field \[CURL Test::Result ; MBS ("[CURL.Perform](CURLPerform.md)"; $curl )\]  
\#close destination file   
Set Variable \[$r ; Value:MBS ("[CURL.CloseOutputFile](CURLCloseOutputFile.md)"; $curl )\]  
\#get debug messages   
Set Field \[CURL Test::debug ; MBS ("[CURL.GetDebugMessages](CURLGetDebugMessages.md)"; $curl )\]  
Set Variable \[$result ; Value:MBS ("[CURL.Release](CURLRelease.md)"; $curl )\]  
Try it on Windows:

 MBS ("[Path.AddPathComponent](PathAddPathComponent.md)"; MBS ( "Folders.SystemTemporary" ); "test")  
<small>  
Example result: C:\\Users\\cs\\AppData\\Local\\Temp\\test</small>### See also

- [CURL.CreateOutputFile](CURLCreateOutputFile.md)
- [CURL.GetDebugMessages](CURLGetDebugMessages.md)
- [CURL.New](CURLNew.md)
- [CURL.Perform](CURLPerform.md)
- [CURL.SetOptionURL](CURLSetOptionURL.md)
- [Files.Launch](FilesLaunch.md)
- [Files.WriteFile](FilesWriteFile.md)
- [Folders.System](FoldersSystem.md)
- [Path.AddPathComponent](PathAddPathComponent.md)
- [Path.LastPathComponent](PathLastPathComponent.md)

This function is free to use.

Created 18th August 2014 , last changed 17th October 2023

  
[Folders.SystemFonts](FoldersSystemFonts.md) - [Folders.UbiquityContainer](FoldersUbiquityContainer.md)

[HTML Version](FoldersSystemTemporary.shtml)