[GRASS-dev] [GRASS GIS] #1303: v.in.ogr leaves TMP file after import

#1303: v.in.ogr leaves TMP file after import
-------------------------+--------------------------------------------------
Reporter: marisn | Owner: grass-dev@…
     Type: defect | Status: new
Priority: minor | Milestone: 6.4.1
Component: Vector | Version: 6.4.1 RCs
Keywords: wingrass | Platform: MSWindows Vista
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
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>
}}}

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1303&gt;
GRASS GIS <http://grass.osgeo.org>

#1303: v.in.ogr leaves TMP file after import
--------------------------------+-------------------------------------------
Reporter: marisn | Owner: grass-dev@…
     Type: defect | Status: new
Priority: minor | Milestone: 6.4.1
Component: Vector | Version: 6.4.1 RCs
Keywords: wingrass, v.in.ogr | Platform: MSWindows Vista
      Cpu: Unspecified |
--------------------------------+-------------------------------------------
Changes (by martinl):

  * keywords: wingrass => wingrass, v.in.ogr

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1303#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#1303: v.in.ogr leaves TMP file after import
--------------------------------+-------------------------------------------
Reporter: marisn | Owner: grass-dev@…
     Type: defect | Status: new
Priority: minor | Milestone: 6.4.1
Component: Vector | Version: 6.4.1 RCs
Keywords: wingrass, v.in.ogr | Platform: MSWindows Vista
      Cpu: Unspecified |
--------------------------------+-------------------------------------------

Comment(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.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1303#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#1303: v.in.ogr leaves TMP file after import
--------------------------------+-------------------------------------------
Reporter: marisn | Owner: grass-dev@…
     Type: defect | Status: new
Priority: minor | Milestone: 6.4.1
Component: Vector | Version: 6.4.1 RCs
Keywords: wingrass, v.in.ogr | Platform: MSWindows Vista
      Cpu: Unspecified |
--------------------------------+-------------------------------------------

Comment(by hamish):

Replying to [comment:2 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

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1303#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#1303: v.in.ogr leaves TMP file after import
--------------------------------+-------------------------------------------
Reporter: marisn | Owner: grass-dev@…
     Type: defect | Status: new
Priority: minor | Milestone: 6.4.1
Component: Vector | Version: 6.4.1 RCs
Keywords: wingrass, v.in.ogr | Platform: MSWindows Vista
      Cpu: Unspecified |
--------------------------------+-------------------------------------------

Comment(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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1303#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#1303: v.in.ogr leaves TMP file after import
--------------------------------+-------------------------------------------
Reporter: marisn | Owner: grass-dev@…
     Type: defect | Status: new
Priority: minor | Milestone: 6.4.1
Component: Vector | Version: 6.4.1 RCs
Keywords: wingrass, v.in.ogr | Platform: MSWindows Vista
      Cpu: Unspecified |
--------------------------------+-------------------------------------------

Comment(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.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1303#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#1303: v.in.ogr leaves TMP file after import
------------------------------+---------------------------------------------
  Reporter: marisn | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: minor | Milestone: 6.4.1
Component: Vector | Version: 6.4.1 RCs
Resolution: duplicate | Keywords: wingrass, v.in.ogr
  Platform: MSWindows Vista | Cpu: Unspecified
------------------------------+---------------------------------------------
Changes (by marisn):

  * status: new => closed
  * resolution: => duplicate

Comment:

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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1303#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>