Thread safety.

When writing out a shapefile; the original shapefile is still on the file 
system (and may be used by another process).  The replacement is written out; 
and then the original is removed, and then the replacement is renamed to be the 
original filename.

I am not sure if that is done with the temp folder though; I thought it was 
done in the same directory as the original shapefile?

Can you tell me where the temp folder is used exactly?

Jody

On 07/02/2011, at 7:09 PM, LSA wrote:

> It came out that this is because of rights assigned to %TEMP% folder. Is 
> there are some means NOT to use %TEMP% , and just create destination files? 
> What are the reasons of using %TEMP% when writing shapefile?
> 
> Thanks,
> Sergey
> 
> On 04.02.2011 22:27, Jody Garnett wrote:
>> Depending on how you open your shapefile (ie the connection parameters); it 
>> will used "memory mapped" file access or not. You can change that to see if 
>> it has any effected.
>> 
>> While your bufferedwriter is an example; the shapefile code uses the java 
>> new io library[1]. This library uses a flle channel metaphore rather than a 
>> writer. So you will need to experiment with those instead in order to 
>> determine how to create a file with everyone permission?
>> 
>> Also depending on the version of Java used there are more abilities to query 
>> and manipulate file details; perhaps you could use these facilities to fix 
>> the file after it has been created?
>> 
>> Jody
>> [1] http://en.wikipedia.org/wiki/New_I/O
>> 
>> On 04/02/2011, at 11:54 PM, LSA wrote:
>> 
>>   
>>> Hi!
>>> 
>>> Our application uses geotools to write shapefiles.
>>> 
>>> Under particular Windows XP instance our application creates shapefiles
>>> without Everyone permission, and this causes troubles.
>>> 
>>> However, code like (launched from under our app):
>>> BufferedWriter bw = new BufferedWriter(new FileWriter(new
>>> File(".").getCanonicalPath() +"/test.txt"));;
>>> bw.write("test");
>>> bw.close();
>>> will create test.txt having Everyone permission.
>>> 
>>> Any ideas would be appreciated...
>>> 
>>> Thanks,
>>> Sergey
>>> 
>>> ------------------------------------------------------------------------------
>>> The modern datacenter depends on network connectivity to access resources
>>> and provide services. The best practices for maximizing a physical server's
>>> connectivity to a physical network are well understood - see how these
>>> rules translate into the virtual world?
>>> http://p.sf.net/sfu/oracle-sfdevnlfb
>>> _______________________________________________
>>> Geotools-gt2-users mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>>     
>>   
> 


------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to