I have a tool which does the following work:

  1. Connects and fetches data from hdf using impala
  2. Create intermediate csv file.
  3. from the csv file it creates custom feature classes.

Currently when running it as a standalone tool I have used absolute paths in the local disks and it works fine. I have used random number to generate different work directories to store the data.

Now I need to publish this tool as a geoprocessing service. So I need to access the server directories to save my intermediate files.

As I read, each time a tool is run it creates a folder with a unique id within arcgisjob folder. If I understood right, I need access to that directory.

Please suggest how to use the folder.

I am using ArcGIS 10.1 Server for Windows.


I recommend using arcpy.env.scratchFolder to handle intermediate files. The ArcGIS help state:

Its primary purpose is for use by scripts and models as geoprocessing services, with the added focus of pointing only to a known folder. When ArcGIS for Server executes a geoprocessing task, the Scratch Folder is always available to write output to.

Scratch Folder is available since ArcGIS 10.1. Prior to 10.1 must use Scratch Workspace instead, which has the drawback of not distinguishing if the scratch environment is a folder or a geodatabase.

  • Thanks for your answer.My question remains as how do I point the scratch workspace as the current job folder within the arcgis server.I have tried setting the scratch folder but when i run it as geoprocessing service it is not creating the intermediate files in the arcjobs folder. – Arijit Bose Jun 17 '14 at 12:10
  • @ArijitBose In the linked documentation: arcpy.env.scratchFolder. That contains a file path. You use it like you would any other file path in Python. – jpmc26 Jun 17 '14 at 18:51
  • @ArijitBose could you please paste your script? It might be easier to identify the problem. – ericchiasson Jun 17 '14 at 22:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.