"The Scratch Folder is the location of a folder you can use to write file-based data, such as shapefiles, text files, and layer files. It is a read-only environment that is managed by ArcGIS.
The Scratch Folder environment complements the scratch workspace environment. Its primary purpose is for use by scripts and models as geoprocessing services, with the added focus of pointing only to a known folder. WhenSome important notes about env.scratchFolder: executes a geoprocessing task, the Scratch Folder is always available to write output to. This environment is also useful in authoring scripts and models for use on the desktop. Writing output to the Scratch Folder will make your tool portable, because this location will always be available or created at execution time."
- It will always exists
- It's read only property
- It will always be folder even if your scratch workspace is set to a file geodatabase
- If there is no Scratch Workspace set in your map document, or you're working in an environment where the Scratch Workspace has not been explicitly set, the Scratch Folder defaults to the current user's temporary files directory. This directory is typically at C:\Users\
\AppData\Local\Temp on Windows 7 or C:\Documents and Settings\ \Localsystem\Temp on Windows XP.
>>> import arcpy
>>> from arcpy import env
>>> env.scratchWorkspace = r"c:\temp\myfgdb.gdb"
>>> print env.scratchFolder