Select to view content in your preferred language

Get the file created by GpService

127
0
07-21-2025 06:54 AM
ModyBuchbinder
Esri Regular Contributor

I have a GpService that create a shape file.

In my code I am writing this file to %scratchFolder%\aaa.shp

It is created in this directory (as it should):

\\disk1\arcgisserver\directories\arcgisjobs\agritest_gpserver\1234\scratch\aaa.shp

Where the 1234 is the job number.

I can use the %scratchFolder%\aaa.shp in my code after is it created (Describe or read it by cursor).

I need to use this file in the calling program so I return the %scratchFolder%\aaa.shp as an output parameter.

The path that I get is: C:\Users\arcgis\AppData\Local\Temp\agritest_gpserver\1234\scratch\aaa.shp

Where arcgis is the owner of the Enterprise and 1234 is the same job number.

This dir exists on the server but it is empty. It looks like it created there temporary and was transferred to the jobs directory after the service ended.

Any way to get the job directory in the code of the gp service so I can return the correct directory?

0 Kudos
0 Replies