Skip to content
Prev 23606 / 29559 Next

spgrass6, readVECT and overwriting ?

Mathieu Rajerison <mathieu.rajerison at gmail.com> writes:
I'll Cc the R-sig-geo list in to keep the conversation there for future
reference and for other users who might have the same problem.
Don't worry abut your English - it is perfectly fine.
The functions readVect / RAST are using temporary files - you are right,
but they should delete these upon exit. So if they do nbot do this, it
is a bug.
OK - thanks.
As I said - if you manually have to delete the temporary files, then
there is a bug in the package. Could you please provide a reproducible
example, using one of the example data sets from GRASS, so that I can
look at it?
Sorry - overlooked it.
OK - reformated, the code looks as follow:

--8<---------------cut here---------------start------------->8---
l = list.files("D:/GRASSDB/paca/mapset/.tmp", "^clean.*$")
l = file.path("D:/GRASSDB/paca/mapset/.tmp", l)
lapply(l,  file.remove)
execGRASS( "v.out.ogr",
           parameters=list(input="clean", type="line",dsn="D:/GRASSDB/paca/mapset/.tmp", olayer="clean", format="ESRI_Shapefile"))
--8<---------------cut here---------------end--------------->8---

as a side note, you should be able to do

file.remove( list.files(path = "D:/GRASSDB/paca/mapset/.tmp", Pattern =
"^clean.*$", full.names = TRUE) )

or

unlink("D:/GRASSDB/paca/mapset/.tmp/clean.*")

instead of the first three commands.

Now - in your example, you don't use the readVECT() function?

If you check in the GRASS help for v.out.ogr, you can specify the
overwrite flag and the exported layer will be overwritten.

But I have the feeling you are doing something in a to complicated way.

What is it you want to do, and e=what is the problem you have or the
error message you get?

Cheers,

Rainer

  
    
Message-ID: <m2lhaoe9sh.fsf@krugs.de>
In-Reply-To: <CAGfc75mgjHT94aZm7bEFkLO5628K-8-UR--Z-FQbpndX3tsSsA@mail.gmail.com> (Mathieu Rajerison's message of "Tue, 27 Oct 2015 13:06:19 +0100")