# Temp Files Directory

**URL:** <https://community.thinkgeo.com/t/temp-files-directory/3768>\
**Category:** WPF\
**Created:** [January 27, 2015, 9:01am UTC](https://community.thinkgeo.com/t/temp-files-directory/3768 "2015-01-27T09:01:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brandon](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/b/f08c70/32.png) [@Brandon](https://community.thinkgeo.com/u/Brandon)\
**Post date:** [January 27, 2015, 9:01am UTC](https://community.thinkgeo.com/t/temp-files-directory/3768/1 "2015-01-27T09:01:55Z")

</div>

Is&nbsp;there&nbsp;a&nbsp;way&nbsp;to&nbsp;control&nbsp;where&nbsp;the&nbsp;temp&nbsp;files&nbsp;are&nbsp;generated?&nbsp;&nbsp;For&nbsp;instance,&nbsp;I&nbsp;have&nbsp;a&nbsp;shapefile&nbsp;names&nbsp;Layer1.shp,&nbsp;and&nbsp;when&nbsp;building&nbsp;an&nbsp;index&nbsp;file,&nbsp;it&nbsp;writes&nbsp;the&nbsp;TMPLayer1.idx&nbsp;to&nbsp;the&nbsp;root&nbsp;drive.&nbsp;&nbsp;Many&nbsp;of&nbsp;my&nbsp;users&nbsp;don’t&nbsp;have&nbsp;admin&nbsp;privileges&nbsp;to&nbsp;write&nbsp;to&nbsp;the&nbsp;root&nbsp;drives,&nbsp;which&nbsp;causes&nbsp;issues&nbsp;when&nbsp;trying&nbsp;to&nbsp;rebuild&nbsp;index&nbsp;files.  
  
  
  
I&nbsp;am&nbsp;looking&nbsp;for&nbsp;a&nbsp;way&nbsp;to&nbsp;default&nbsp;the&nbsp;placement&nbsp;of&nbsp;temporary&nbsp;files&nbsp;to&nbsp;a&nbsp;local&nbsp;directory&nbsp;to&nbsp;the&nbsp;WPF&nbsp;program.&nbsp;&nbsp;Is&nbsp;that&nbsp;possible&nbsp;yet?&nbsp;

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [January 28, 2015, 1:07am UTC](https://community.thinkgeo.com/t/temp-files-directory/3768/2 "2015-01-28T01:07:21Z")

</div>

Hi&nbsp;Brandon,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Sorry&nbsp;it&nbsp;looks&nbsp;the&nbsp;temp&nbsp;location&nbsp;won’t&nbsp;be&nbsp;changed,&nbsp;in&nbsp;fact&nbsp;we&nbsp;always&nbsp;put&nbsp;the&nbsp;temp&nbsp;file&nbsp;in&nbsp;same&nbsp;folder&nbsp;with&nbsp;data&nbsp;file.&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;think&nbsp;if&nbsp;your&nbsp;users&nbsp;can&nbsp;only&nbsp;read&nbsp;the&nbsp;data,&nbsp;could&nbsp;you&nbsp;please&nbsp;pre-build&nbsp;index&nbsp;file&nbsp;for&nbsp;all&nbsp;of&nbsp;your&nbsp;data,&nbsp;you&nbsp;just&nbsp;need&nbsp;create&nbsp;a&nbsp;simple&nbsp;program&nbsp;for&nbsp;that.&nbsp;  
&nbsp;&nbsp;  
&nbsp;If&nbsp;that&nbsp;data&nbsp;is&nbsp;uploaded&nbsp;by&nbsp;your&nbsp;user,&nbsp;I&nbsp;think&nbsp;you&nbsp;can&nbsp;also&nbsp;provide&nbsp;a&nbsp;utility&nbsp;to&nbsp;your&nbsp;users&nbsp;so&nbsp;that&nbsp;they&nbsp;can&nbsp;build&nbsp;index&nbsp;after&nbsp;they&nbsp;upload&nbsp;data.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Don

---

<div class="post-metadata">

**Author:** ![Brandon](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/b/f08c70/32.png) [@Brandon](https://community.thinkgeo.com/u/Brandon)\
**Post date:** [January 28, 2015, 7:53am UTC](https://community.thinkgeo.com/t/temp-files-directory/3768/3 "2015-01-28T07:53:35Z")

</div>

Don…&nbsp;Thanks&nbsp;for&nbsp;the&nbsp;quick&nbsp;response.&nbsp;&nbsp;You&nbsp;say&nbsp;the&nbsp;TMP&nbsp;file&nbsp;should&nbsp;be&nbsp;in&nbsp;the&nbsp;directory&nbsp;where&nbsp;the&nbsp;original&nbsp;is.&nbsp;&nbsp;However,&nbsp;my&nbsp;permissions&nbsp;error&nbsp;labels&nbsp;it&nbsp;as&nbsp;C:\TMPLayer1.idx&nbsp;when&nbsp;my&nbsp;Layer1.idx&nbsp;file&nbsp;is&nbsp;actually&nbsp;located&nbsp;in&nbsp;C:\XX\XX\Layer1.idx.&nbsp;&nbsp;My&nbsp;user&nbsp;is&nbsp;able&nbsp;to&nbsp;have&nbsp;permissions&nbsp;to&nbsp;the&nbsp;\XX\XX&nbsp;directory,&nbsp;but&nbsp;they&nbsp;have&nbsp;been&nbsp;locked&nbsp;out&nbsp;of&nbsp;direct&nbsp;C:&#160;access.&nbsp;  
&nbsp;&nbsp;  
&nbsp;As&nbsp;for&nbsp;prebuilding&nbsp;the&nbsp;index.&nbsp;&nbsp;We&nbsp;do&nbsp;prebuild&nbsp;it,&nbsp;but&nbsp;we&nbsp;also&nbsp;clear&nbsp;existing&nbsp;shapefiles,&nbsp;rebuilding&nbsp;existing&nbsp;shapefiles,&nbsp;and&nbsp;create&nbsp;new&nbsp;shapefiles&nbsp;from&nbsp;the&nbsp;client&nbsp;machines&nbsp;with&nbsp;the&nbsp;permissions&nbsp;issues.&nbsp;&nbsp;We&nbsp;have&nbsp;enough&nbsp;users&nbsp;that&nbsp;we&nbsp;cannot&nbsp;prebuild&nbsp;index&nbsp;files&nbsp;individually&nbsp;for&nbsp;operation&nbsp;that&nbsp;requires&nbsp;it,&nbsp;which&nbsp;is&nbsp;why&nbsp;we&nbsp;pushed&nbsp;that&nbsp;responsibility&nbsp;to&nbsp;the&nbsp;client&nbsp;machines.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Plus,&nbsp;there&nbsp;are&nbsp;occasions&nbsp;where&nbsp;some&nbsp;of&nbsp;our&nbsp;users&nbsp;have&nbsp;corrupted&nbsp;their&nbsp;data&nbsp;and&nbsp;their&nbsp;index&nbsp;files.&nbsp;&nbsp;We&nbsp;gave&nbsp;them&nbsp;the&nbsp;power&nbsp;to&nbsp;recreate&nbsp;their&nbsp;materials&nbsp;on&nbsp;demand&nbsp;because&nbsp;half&nbsp;the&nbsp;time&nbsp;they’re&nbsp;miles&nbsp;away&nbsp;from&nbsp;anywhere&nbsp;with&nbsp;an&nbsp;internet&nbsp;connection&nbsp;collecting&nbsp;data.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Our&nbsp;users&nbsp;are&nbsp;uploading&nbsp;data&nbsp;to&nbsp;our&nbsp;servers.&nbsp;&nbsp;Once&nbsp;that&nbsp;is&nbsp;finished,&nbsp;they&nbsp;are&nbsp;clearing&nbsp;their&nbsp;shapefiles&nbsp;and&nbsp;rebuilding.&nbsp;&nbsp;That&nbsp;is&nbsp;where&nbsp;we&nbsp;are&nbsp;running&nbsp;into&nbsp;the&nbsp;permissions&nbsp;issue&nbsp;on&nbsp;the&nbsp;root&nbsp;C:&#160;drive.&nbsp;  
&nbsp;&nbsp;  
&nbsp;We&nbsp;are&nbsp;running&nbsp;off&nbsp;version&nbsp;8.0.0.129.&nbsp;&nbsp;Perhaps&nbsp;this&nbsp;version&nbsp;is&nbsp;different?

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [January 29, 2015, 2:56am UTC](https://community.thinkgeo.com/t/temp-files-directory/3768/4 "2015-01-29T02:56:43Z")

</div>

Hi&nbsp;Brandon,&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;double&nbsp;check&nbsp;the&nbsp;code&nbsp;again,&nbsp;I&nbsp;am&nbsp;sure&nbsp;we&nbsp;generate&nbsp;temp&nbsp;file&nbsp;to&nbsp;in&nbsp;shape&nbsp;file&nbsp;folder&nbsp;and&nbsp;this&nbsp;logic&nbsp;haven’t&nbsp;been&nbsp;changed&nbsp;for&nbsp;long&nbsp;time,&nbsp;so&nbsp;I&nbsp;think&nbsp;the&nbsp;version&nbsp;is&nbsp;not&nbsp;problem.&nbsp;  
&nbsp;&nbsp;  
&nbsp;We&nbsp;get&nbsp;index&nbsp;file&nbsp;path&nbsp;like&nbsp;this:&nbsp;  
&nbsp;Path.ChangeExtension(shapePathFilename,&nbsp;“.idx”)&nbsp;  
&nbsp;&nbsp;  
&nbsp;and&nbsp;this&nbsp;is&nbsp;temp&nbsp;file&nbsp;path:&nbsp;  
&nbsp;Path.GetDirectoryName(indexPathFilename)&nbsp;+&nbsp;“\TMP”&nbsp;+&nbsp;Path.GetFileName(indexPathFilename)&nbsp;  
&nbsp;&nbsp;  
&nbsp;so&nbsp;I&nbsp;am&nbsp;sure&nbsp;we&nbsp;won’t&nbsp;create&nbsp;the&nbsp;tmp&nbsp;file&nbsp;on&nbsp;root&nbsp;folder.&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;think&nbsp;you&nbsp;can&nbsp;do&nbsp;something&nbsp;now:&nbsp;  
&nbsp;1.&nbsp;You&nbsp;can&nbsp;login&nbsp;with&nbsp;administrator&nbsp;account&nbsp;and&nbsp;build&nbsp;index&nbsp;file&nbsp;for&nbsp;a&nbsp;big&nbsp;shape&nbsp;file,&nbsp;then&nbsp;see&nbsp;whether&nbsp;the&nbsp;temp&nbsp;file&nbsp;generated&nbsp;under&nbsp;root&nbsp;folder.&nbsp;  
&nbsp;2.&nbsp;Please&nbsp;make&nbsp;sure&nbsp;you&nbsp;haven’t&nbsp;set&nbsp;the&nbsp;index&nbsp;path&nbsp;when&nbsp;you&nbsp;call&nbsp;BuildIndexFile&nbsp;API,&nbsp;just&nbsp;use&nbsp;the&nbsp;simplest&nbsp;one&nbsp;BuildIndexFile&nbsp;is&nbsp;OK.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Any&nbsp;news&nbsp;please&nbsp;let&nbsp;me&nbsp;know.&nbsp;  
&nbsp;&nbsp;  
&nbsp;For&nbsp;workaround,&nbsp;do&nbsp;you&nbsp;think&nbsp;create&nbsp;a&nbsp;service&nbsp;on&nbsp;server&nbsp;to&nbsp;check&nbsp;index&nbsp;file&nbsp;and&nbsp;build&nbsp;index&nbsp;file&nbsp;is&nbsp;viable&nbsp;if&nbsp;the&nbsp;security&nbsp;issue&nbsp;cannot&nbsp;be&nbsp;solved?&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regard,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Don

---

<div class="post-metadata">

**Author:** ![Brandon](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/b/f08c70/32.png) [@Brandon](https://community.thinkgeo.com/u/Brandon)\
**Post date:** [January 30, 2015, 7:32am UTC](https://community.thinkgeo.com/t/temp-files-directory/3768/5 "2015-01-30T07:32:47Z")

</div>

Don…&nbsp;&nbsp;I&nbsp;checked&nbsp;with&nbsp;the&nbsp;process&nbsp;on&nbsp;my&nbsp;local&nbsp;system&nbsp;where&nbsp;I&nbsp;am&nbsp;an&nbsp;administrator,&nbsp;and&nbsp;I&nbsp;do&nbsp;see&nbsp;the&nbsp;file&nbsp;generating&nbsp;in&nbsp;the&nbsp;same&nbsp;directory.&nbsp;&nbsp;That&nbsp;part&nbsp;is&nbsp;true&nbsp;for&nbsp;what&nbsp;you&nbsp;said.&nbsp;&nbsp;I&nbsp;wonder&nbsp;if&nbsp;the&nbsp;generation&nbsp;on&nbsp;the&nbsp;root&nbsp;drive&nbsp;has&nbsp;something&nbsp;to&nbsp;do&nbsp;with&nbsp;the&nbsp;Path&nbsp;module&nbsp;and&nbsp;how&nbsp;the&nbsp;application&nbsp;permissions&nbsp;play&nbsp;into&nbsp;it.&nbsp;&nbsp;I&nbsp;believe&nbsp;right&nbsp;now&nbsp;we&nbsp;are&nbsp;able&nbsp;to&nbsp;open&nbsp;the&nbsp;program&nbsp;as&nbsp;administrator&nbsp;and&nbsp;not&nbsp;have&nbsp;the&nbsp;issue.&nbsp;&nbsp;However,&nbsp;I&nbsp;am&nbsp;not&nbsp;sure&nbsp;if&nbsp;someone&nbsp;somewhere&nbsp;may&nbsp;find&nbsp;that&nbsp;a&nbsp;security&nbsp;issue&nbsp;sometime.&nbsp;&nbsp;So,&nbsp;we&nbsp;were&nbsp;looking&nbsp;for&nbsp;a&nbsp;disconnected&nbsp;option&nbsp;that&nbsp;would&nbsp;work&nbsp;whenever&nbsp;a&nbsp;limited&nbsp;user&nbsp;needs&nbsp;it&nbsp;to.&nbsp;&nbsp;The&nbsp;way&nbsp;I&nbsp;have&nbsp;it&nbsp;set&nbsp;is&nbsp;`ShapefileFeatureSource.BuildIndexFile(pathToShapefile, BuildIndexMode.DoNotRebuild`.&nbsp;&nbsp;There&nbsp;are&nbsp;other&nbsp;processes&nbsp;that&nbsp;pretty&nbsp;much&nbsp;mimic&nbsp;that&nbsp;throughout&nbsp;the&nbsp;application.&nbsp;  
&nbsp;&nbsp;  
&nbsp;If&nbsp;you&nbsp;have&nbsp;any&nbsp;other&nbsp;thoughts,&nbsp;please&nbsp;let&nbsp;me&nbsp;know.&nbsp;&nbsp;Thanks!

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [February 2, 2015, 1:37am UTC](https://community.thinkgeo.com/t/temp-files-directory/3768/6 "2015-02-02T01:37:49Z")

</div>

Hi&nbsp;Brandon,&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;did&nbsp;some&nbsp;research&nbsp;but&nbsp;haven’t&nbsp;found&nbsp;related&nbsp;topics&nbsp;talk&nbsp;about&nbsp;whether&nbsp;the&nbsp;API&nbsp;under&nbsp;“Path”&nbsp;will&nbsp;access&nbsp;root&nbsp;driver,&nbsp;and&nbsp;for&nbsp;some&nbsp;reason&nbsp;I&nbsp;cannot&nbsp;test&nbsp;that&nbsp;in&nbsp;local&nbsp;machine,&nbsp;so&nbsp;if&nbsp;you&nbsp;have&nbsp;more&nbsp;detail&nbsp;information&nbsp;about&nbsp;that&nbsp;please&nbsp;let&nbsp;me&nbsp;know.&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;have&nbsp;a&nbsp;question&nbsp;here,&nbsp;it&nbsp;looks&nbsp;you&nbsp;are&nbsp;using&nbsp;WPF&nbsp;edition&nbsp;and&nbsp;that&nbsp;should&nbsp;have&nbsp;a&nbsp;client&nbsp;app&nbsp;run&nbsp;on&nbsp;user’s&nbsp;machine,&nbsp;which&nbsp;means&nbsp;they&nbsp;can&nbsp;build&nbsp;index&nbsp;file&nbsp;before&nbsp;upload&nbsp;data&nbsp;or&nbsp;modified&nbsp;data,&nbsp;do&nbsp;you&nbsp;think&nbsp;we&nbsp;can&nbsp;move&nbsp;build&nbsp;index&nbsp;part&nbsp;to&nbsp;user’s&nbsp;machine?&nbsp;  
&nbsp;&nbsp;  
&nbsp;If&nbsp;I&nbsp;get&nbsp;any&nbsp;thought&nbsp;about&nbsp;that&nbsp;I&nbsp;will&nbsp;let&nbsp;you&nbsp;know.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Don
