[GRASS-dev] [GRASS GIS] #1106: r.terraflow limited to 32bit temp files in WinGrass

#1106: r.terraflow limited to 32bit temp files in WinGrass
-----------------------------------+----------------------------------------
Reporter: hamish | Owner: grass-dev@…
     Type: task | Status: new
Priority: normal | Milestone: 6.4.1
Component: Raster | Version: svn-develbranch6
Keywords: wingrass, r.terraflow | Platform: MSWindows XP
      Cpu: x86-32 |
-----------------------------------+----------------------------------------
Hi,

moving this out of the noise of #1006 so we can close that one asap.

part of the work-around for the #1006 r.terraflow on WinGrass fix replaces
stat() with ftell(), as stat() on Windows gives undefined results if the
file is still open.

The ftell() solution is not 32bit safe though, so it awaits a backport of
G_ftell() [or even better `off_t G_filesize()`] in some later release.

This does not affect the UNIX side of things, the ftell() is within a
#ifdef.

Hamish

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

#1106: r.terraflow limited to 32bit temp files in WinGrass
-----------------------------------+----------------------------------------
Reporter: hamish | Owner: grass-dev@…
     Type: task | Status: new
Priority: normal | Milestone: 6.4.1
Component: Raster | Version: svn-develbranch6
Keywords: wingrass, r.terraflow | Platform: MSWindows XP
      Cpu: x86-32 |
-----------------------------------+----------------------------------------
Description changed by hamish:

Old description:

Hi,

moving this out of the noise of #1006 so we can close that one asap.

part of the work-around for the #1006 r.terraflow on WinGrass fix
replaces stat() with ftell(), as stat() on Windows gives undefined
results if the file is still open.

The ftell() solution is not 32bit safe though, so it awaits a backport of
G_ftell() [or even better `off_t G_filesize()`] in some later release.

This does not affect the UNIX side of things, the ftell() is within a
#ifdef.

Hamish

New description:

Hi,

moving this out of the noise of #1006 so we can close that one asap.

part of the work-around for the #1006 r.terraflow on WinGrass fix replaces
stat() with ftell(), as stat() on Windows gives undefined results if the
file is still open.

The ftell() solution is not 64bit safe though, so it awaits a backport of
G_ftell() [or even better `off_t G_filesize()`] in some later release.

This does not affect the UNIX side of things, the ftell() is within a
#ifdef.

Hamish

--

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

#1106: r.terraflow limited to 32bit temp files in WinGrass
-----------------------------------+----------------------------------------
Reporter: hamish | Owner: grass-dev@…
     Type: task | Status: new
Priority: normal | Milestone: 6.4.1
Component: Raster | Version: svn-develbranch6
Keywords: wingrass, r.terraflow | Platform: MSWindows XP
      Cpu: x86-32 |
-----------------------------------+----------------------------------------

Comment(by mmetz):

Replying to [ticket:1106 hamish]:
>
> The ftell() solution is not 64bit safe though, so it awaits a backport
of G_ftell() [or even better `off_t G_filesize()`] in some later release.
>

AFAICT this will only work if LFS is globally enabled/disabled in grass,
as in grass7. The modifications done in grass7 are probably too
fundamental to backport (not sure about libgis and the raster part, but
for the vector part I had to change core functions in the vector libs).

BTW, the 2GB temp file limit also applies to various other modules (all
vector modules, r.watershed.seg, r.cost, r.walk, r.drain, r.proj...)

Markus M

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

#1106: r.terraflow limited to 32bit temp files in WinGrass
---------------------------+------------------------------------------------
  Reporter: hamish | Owner: grass-dev@…
      Type: task | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: Raster | Version: svn-develbranch6
Resolution: fixed | Keywords: wingrass, r.terraflow
  Platform: MSWindows XP | Cpu: x86-32
---------------------------+------------------------------------------------
Changes (by mmetz):

  * status: new => closed
  * resolution: => fixed
  * milestone: 6.4.1 => 7.0.0

Comment:

Replying to [comment:2 mmetz]:
> Replying to [ticket:1106 hamish]:
> >
> > The ftell() solution is not 64bit safe though, so it awaits a backport
of G_ftell() [or even better `off_t G_filesize()`] in some later release.
> >

Why backport working solutions instead of releasing working solutions?
>
> AFAICT this will only work if LFS is globally enabled/disabled in grass,
as in grass7. The modifications done in grass7 are probably too
fundamental to backport (not sure about libgis and the raster part, but
for the vector part I had to change core functions in the vector libs).

That would require backporting core parts of trunk. This won't be fixed
for GRASS 6 and has been fixed some time ago for GRASS 7.

Markus M

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