Mark wrote:
> I have a Perl program that loops through the r.lake module, and
> captures output. In the program, there are a few instances where I
> would like to test if a given raster already exists. In perl, its
> something like this to test if a file exists ... if (-e "filename") {
> do stuff }.
José Antonio Ruiz Arias wrote:
> Try with g.findfile element=cell file=<your_raster_name> in a Perl
> pipe. If the module returns a series of empty strings, your raster
> does not exist.
You can also test g.findfile's return code, it returns 0 if the file was
found, 1 if not.
Hamish
_______________________________________________
grassuser mailing list
[email protected]
http://grass.itc.it/mailman/listinfo/grassuser