Opened 8 years ago

Closed 8 years ago

#1303 closed defect (duplicate)

v.in.ogr leaves TMP file after import

Reported by: marisn Owned by: grass-dev@…
Priority: minor Milestone: 6.4.1
Component: Vector Version: 6.4.1 RCs
Keywords: wingrass, v.in.ogr Cc:
CPU: Unspecified Platform: MSWindows Vista

Description

After importing ESRI Shapefile, v.in.ogr leaves map with name MYMAP_tmp. Imported vector is fine, it's possible to use g.remove to delete _tmp file.

GRASS 6.4.1RC1 on Windows Vista

Datum <unknown> not recognised by GRASS and no parameters found
Building topology for vector map <horizontales>...
Registering primitives...
217 primitives registered
7346 vertices registered
Building areas...
0 areas built
0 isles built
Attaching islands...
Attaching centroids...
Number of primitives: 217
Number of points: 0
Number of lines: 217
Number of boundaries: 0
Number of centroids: 0
Number of areas: 0
Number of isles: 0
Number of nodes: 320
Projection of input dataset and current location appear to match
Layer: Dores_horiz_10k
Counting polygons for 217 features...
Importing map 217 features...
-----------------------------------------------------
Building topology for vector map <horizontales_tmp>...
Registering primitives...
217 primitives registered
7346 vertices registered
Number of nodes: 320
Number of primitives: 217
Number of points: 0
Number of lines: 217
Number of boundaries: 0
Number of centroids: 0
Number of areas: -
Number of isles: -
Unable to delete file 'C:\Users\tests\Documents\GIS_DataBase/Latvija/SRTM/vector/horizontales_tmp/coor'


g.remove vect=horizontales_tmp@SRTM
Removing vector <horizontales_tmp@SRTM>

Change History (6)

comment:1 Changed 8 years ago by martinl

Keywords: v.in.ogr added

comment:2 Changed 8 years ago by neteler

Unable to delete file 'C:\Users\tests\Documents\GIS_DataBase/Latvija/SRTM/vector/horizontales_tmp/coor'

... this problem looks like the elsewhere fixed \ versus / confusion.

comment:3 in reply to:  2 Changed 8 years ago by hamish

Replying to neteler:

> Unable to delete file 'C:\Users\tests\Documents\GIS_DataBase/Latvija/SRTM/vector/horizontales_tmp/coor'

... this problem looks like the elsewhere fixed \ versus / confusion.

can we isolate what bit of code is creating that error message? For some functions the mixed slashes seem to work ok, for others not. It would be good to know exactly which unlink() etc is safe or not so we can do a bulk audit, and I'm not a fan of 'fixing' stuff which isn't actually broken as it just clutters the code.

thanks, Hamish

comment:4 Changed 8 years ago by marisn

I added extra debug info printing in 6.5 in r46027 Will have to wait till it propogates to WinGRASS nightly and then rerun tests.

Hamish - it's Vect_delete at lib/vector/Vlib/map.c

comment:5 Changed 8 years ago by marisn

It's not / vs \ issue. Here's output of current 6.5 on Vista.

Unable to delete file 'C:/Users/tests/Documents/GIS_DataBase/latvija/zonde/vector/rm_pilsetas1_tmp/coor'. Reason: Permission denied

I have full write access to that directory and also I can delete all files with g.remove.

This leads to timing (or background process) issue - it's not possible to delete open file in Windows. Now we need to figure out where closing file handle takes more time than simply calling Vect_close.

Some notes: I disabled file indexing and my antivirus software to prevent file locking by those activities - no changes. Also I see this error only when importing small files (i.e. one with 77 points) and not large ones. If we will not manage to find real cause of this issue, we can IFDEF small sleep on Windows to guarantee release of all file handles before trying to unlink coor et al.

comment:6 Changed 8 years ago by marisn

Resolution: duplicate
Status: newclosed

Closing this bug, as it seems to be a variation of #1158

Note: See TracTickets for help on using tickets.