[GRASS-user] Issue with addon r.vif in MS Windows GUI installations (stand-alone v. 7.2.2 and 7.0.5)

Helmut Kudrnovsky hellik at web.de
Fri Feb 2 09:55:27 PST 2018


>I see you commented out the line that removes the temporary file.

it was just for debugging to find the issue.

>Any idea how I can do that in such a way that it works on both Linux and
Windows?

https://docs.python.org/2/library/tempfile.html

that's maybe an alternative:


tempfile.TemporaryFile([mode='w+b'[, bufsize=-1[, suffix=''[, prefix='tmp'[,
dir=None]]]]])

    Return a file-like object that can be used as a temporary storage area.
The file is created using mkstemp(). It will be destroyed as soon as it is
closed (including an implicit close when the object is garbage collected).
Under Unix, the directory entry for the file is removed immediately after
the file is created. Other platforms do not support this; your code should
not rely on a temporary file created using this function having or not
having a visible name in the file system.

    The mode parameter defaults to 'w+b' so that the file created can be
read and written without being closed. Binary mode is used so that it
behaves consistently on all platforms without regard for the data that is
stored. bufsize defaults to -1, meaning that the operating system default is
used.

    The dir, prefix and suffix parameters are passed to mkstemp().

    The returned object is a true file object on POSIX platforms. On other
platforms, it is a file-like object whose file attribute is the underlying
true file object. This file-like object can be used in a with statement,
just like a normal file.






-----
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html


More information about the grass-user mailing list