GetTempPath Activity
Purpose: This activity gets the system temporary directory path. The temporary directory is a system-defined location where temporary files can be stored. This path is typically used for creating temporary files that will be cleaned up later.
Input Properties
This activity has no input properties.
Output Properties
The system temporary directory path. This is the path to the system's temporary directory where temporary files are typically stored.
Type: string
Note: Returns the temporary directory path if successful, or an error message (starting with "Error: ") if an error occurs. On Windows, this is typically something like "C:\Users\Username\AppData\Local\Temp\".
Example: "C:\Users\Username\AppData\Local\Temp\"
Usage Example
Scenario: Get the system temporary directory path Configuration: (No inputs required) Result: - TempPath: "C:\Users\Username\AppData\Local\Temp\" Scenario: Use temp path to create a temporary file Configuration: 1. Use GetTempPath to get temp directory 2. Use CombinePath to combine temp path with filename 3. Use CreateFile to create file in temp directory Result: - TempPath: "C:\Users\Username\AppData\Local\Temp\" - CombinedPath: "C:\Users\Username\AppData\Local\Temp\TempFile.txt"
Error Handling
Important: The activity handles errors gracefully:
- If any exception occurs,
TempPathwill contain: "Error: {exception message}" - The activity does not throw exceptions - errors are indicated in the
TempPathoutput
Note: This activity rarely fails, as it retrieves a system-defined path. If an error occurs, check the TempPath output for the error message.
Important Notes
- This activity has no input properties - it automatically retrieves the system temporary directory
- The temporary directory path is system-defined and may vary by operating system and user
- On Windows, the path typically ends with a backslash (e.g., "C:\Users\...\Temp\")
- Use this path for creating temporary files that will be cleaned up later
- Combine with CombinePath and CreateFile to create temporary files
- The temporary directory is typically cleaned up by the operating system, but you should clean up your own temporary files
Related Activities
- CombinePath - Combine temp path with filename
- CreateFile - Create a temporary file
- DeleteFile - Delete temporary files when done