[GRASS-dev] Re: [GRASS GIS] #1158: Removing vector map in Windows fails with "Unable to delete vector map"

GRASS GIS trac at osgeo.org
Wed Apr 20 10:09:25 EDT 2011


#1158: Removing vector map in Windows fails with "Unable to delete vector map"
--------------------------------------------------------------------------+-
 Reporter:  lponti                                                        |       Owner:  grass-dev@…              
     Type:  defect                                                        |      Status:  new                      
 Priority:  blocker                                                       |   Milestone:  6.4.2                    
Component:  Vector                                                        |     Version:  6.4.0                    
 Keywords:  wingrass, g.mremove, wildcards, v.in.ogr, v.select, g.remove  |    Platform:  MSWindows 7              
      Cpu:  Unspecified                                                   |  
--------------------------------------------------------------------------+-

Comment(by glynn):

 Replying to [comment:25 mmetz]:

 > Hopefully fixed for devbr in r46041.
 >
 > Vect_delete() uses unlink(), whereas raster and all other files are
 removed by remove(): the file will remain in existence until the last file
 descriptor referring to it is closed (at least on Linux). In
 Vect_delete(), I have replaced unlink() with remove(), working on Linux,
 awaits testing on Windows.

 I'm fairly sure that r46041 has no effect. On Unix, the difference between
 remove() and unlink() is that remove() handles both files and directories;
 it calls unlink() for files and rmdir() for directories. unlink() only
 works on files.

 The "garbage-collecting" behaviour (a file is removed when it has no links
 and no process has it open) always applies. There is no way to force
 deletion of a file which is open, or to remove all links to a file (there
 may exist links in directories on which the process lacks write
 permission, in directories which are inaccessible due to having another
 filesystem mounted over them, etc).

 On Windows, I can't discern any difference between unlink() and remove().
 Unlike Unix, remove() only works for files. And unlike Unix, you can't
 "unlink" a file which is open; the unlink/remove call fails with EACCESS.

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/1158#comment:27>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list