Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My end goal is to get an excel (I'll probably just settle for .csv) file loaded from a silverlight app into my "%SCRATCHWORKSPACE%" for my gp service. I will be linear referencing the data onto a polyline.

I have silverlight reading the csv file's contents and packing it into a string to send over to ArcGIS Server.

Then I want to write this data to a csv file in the "%SCRATCHWORKSPACE%". But I don't seem to be able to use any standard python code to hit the "%SCRATCHWORKSPACE%".

Any thoughts or critiques?

share|improve this question

Set an input to your gp service to be the %scratchworkspace% - this should get resolved by ArcGIS Server into a actual directory path on disk that (assuming the SOC account has access to the folders) you should be able to write to no worries. It will end up in the arcgisjobs folder, in a subfolder under the name of the service, and then under another subfolder that is created by ArcGIS Server on a random text string. e.g.:


Last tip is that this doesn't get cleaned up automatically, so you'll have to set that up yourself.

Hope this helps!

share|improve this answer
I have no issues writing to the the job folder j5f4eb1370ded4e8e99a17519c0989850\scratch\ folder with arcpy methods but I can't do os.rename(src,dst). I get an error saying the directory is not found. – Justin Apr 18 '12 at 12:51
up vote 0 down vote accepted

arcpy.env.scratchWorkspace yields


Which allowed my to use non-arcpy methods targeting the scratch workspace of a gp service job request.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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