No such file or directory

8 messages Options
Embed this post
Permalink
Peter Brooks-3

No such file or directory

Reply Threaded More More options
Print post
Permalink
Hi, I've downloaded the 'ncexternal' data from the grassbook website -
  I created a 'ncexternal' mapset folder and copied the files into
there.

Whenever I try the examples that access import or process these files
I get an error message in GRASS. For example on p62

r.in.poly in=newfacility.txt out=new_facility_1m

gives

newfacility.txt: No such file or directory

although the file is there. I have tried adding the folder to the
Windows path, but that doesn't solve it.

I am probably doing something stupid or have missed (or skipped :)
something obvious... I would be grateful for any help.

Many thanks
Peter
_______________________________________________
grass-windows mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-windows
Markus Neteler

Re: No such file or directory

Reply Threaded More More options
Print post
Permalink
On Fri, Aug 14, 2009 at 12:53 PM, Peter Brooks<[hidden email]> wrote:

> Hi, I've downloaded the 'ncexternal' data from the grassbook website -
>  I created a 'ncexternal' mapset folder and copied the files into
> there.
>
> Whenever I try the examples that access import or process these files
> I get an error message in GRASS. For example on p62
>
> r.in.poly in=newfacility.txt out=new_facility_1m
>
> gives
>
> newfacility.txt: No such file or directory
>
> although the file is there. I have tried adding the folder to the
> Windows path, but that doesn't solve it.

Peter - two ideas:

- does it work when you use the GUI (i.e., launch r.in.poly without
  parameters)?
- does the path to newfacility.txt contain white space? We are still
   hunting down those cases where it fails

best
Markus
_______________________________________________
grass-windows mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-windows
Peter Brooks-3

Re: No such file or directory

Reply Threaded More More options
Print post
Permalink
Hi Markus,

 - yes it works using the GUI (should have thought to try this)

 - yes, the path contains whitespaces. Using speech or quote marks
around the full path + filename sorts it.  Falls over without. A path
without whitespace works but requires unix style forward slashes.


(I stupidly thought that by creating a mapset and saving the data
into that folder GRASS would be able to find it... didn't think I
would need the full path. Will now move the data to a c:\ncexternal
folder to reduce typing :-)

Many thanks
Peter


On 14 Aug 2009 at 13:44, Markus Neteler wrote:

On Fri, Aug 14, 2009 at 12:53 PM, Peter Brooks<[hidden email]>
wrote: > Hi, I've downloaded the 'ncexternal' data from the grassbook
website - >  I created a 'ncexternal' mapset folder and copied the
files into > there. > > Whenever I try the examples that access
import
or process these files > I get an error message in GRASS. For example
on p62 > > r.in.poly in=newfacility.txt out=new_facility_1m > > gives
> > newfacility.txt: No such file or directory > > although the file
is there. I have tried adding the folder to the > Windows path, but
that doesn't solve it.

Peter - two ideas:

- does it work when you use the GUI (i.e., launch r.in.poly without
  parameters)?
- does the path to newfacility.txt contain white space? We are still
   hunting down those cases where it fails

best
Markus
_______________________________________________
grass-windows mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-windows
Markus Neteler

Re: No such file or directory

Reply Threaded More More options
Print post
Permalink
hi Peter,

On Fri, Aug 14, 2009 at 2:58 PM, Peter Brooks<[hidden email]> wrote:
> Hi Markus,
>
>  - yes it works using the GUI (should have thought to try this)

ok, good.

>  - yes, the path contains whitespaces. Using speech or quote marks
> around the full path + filename sorts it.  Falls over without. A path
> without whitespace works but requires unix style forward slashes.

I darkly remember that we added some Windows-magic for that
elsewhere but I don't remember how.


> (I stupidly thought that by creating a mapset and saving the data
> into that folder GRASS would be able to find it...

It does so on non-Windows and it should "learn" it also on Windows!

I tried:

GRASS 6.4.0svn (nc_spm_08): > r.in.poly in=/tmp/dd\ dd/newfacility.txt
out=new_facility_1m
Writing raster map...
 100%

GRASS 6.4.0svn (nc_spm_08): > cd /tmp/dd\ dd/
GRASS 6.4.0svn (nc_spm_08):/tmp/dd dd > r.in.poly in=./newfacility.txt
out=new_facility_1m --o
Writing raster map...
 100%

Works. So it may be rather the slash stuff than white space?

> didn't think I
> would need the full path. Will now move the data to a c:\ncexternal
> folder to reduce typing :-)

Yes, for now - we hope to figure out the problem.

Please consider to open a bug report with these findings.

best
Markus
_______________________________________________
grass-windows mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-windows
Peter Brooks-3

Re: No such file or directory

Reply Threaded More More options
Print post
Permalink
No, I think it is whitespace...  I'm trying to use the 'cmd >' field
in the 'GRASS GIS Layer Manager' (the new wxPython GUI).  I guess
this is what a Windows user would try to do :-)

I tried adding a space to the folder name (= 'c:\nc external'),
forward slashes don't help but speech or quote marks do.

(I think the same thing happens with all r.in commands if they are
looking for external files - is this to be expected?)


Using the GRASS Command line utility (DOS shell type interface):

GRASS 6.4.0svn (North-Carolina)> cd c:/nc external
The system cannot find the path specified.

GRASS 6.4.0svn (North-Carolina)> cd c:\nc external
(works ok)


Thanks
Peter


On 14 Aug 2009 at 15:14, Markus Neteler wrote:

hi Peter,

On Fri, Aug 14, 2009 at 2:58 PM, Peter Brooks<[hidden email]>
wrote: > Hi Markus, > >  - yes it works using the GUI (should have
thought to try this)

ok, good.

>  - yes, the path contains whitespaces. Using speech or quote marks
> around the full path + filename sorts it.  Falls over without. A
> path without whitespace works but requires unix style forward
> slashes.

I darkly remember that we added some Windows-magic for that
elsewhere but I don't remember how.


> (I stupidly thought that by creating a mapset and saving the data
> into that folder GRASS would be able to find it...

It does so on non-Windows and it should "learn" it also on Windows!

I tried:

GRASS 6.4.0svn (nc_spm_08): > r.in.poly in=/tmp/dd\
dd/newfacility.txt
out=new_facility_1m Writing raster map...
 100%

GRASS 6.4.0svn (nc_spm_08): > cd /tmp/dd\ dd/
GRASS 6.4.0svn (nc_spm_08):/tmp/dd dd > r.in.poly
in=./newfacility.txt
out=new_facility_1m --o Writing raster map...
 100%

Works. So it may be rather the slash stuff than white space?

> didn't think I
> would need the full path. Will now move the data to a c:\ncexternal
> folder to reduce typing :-)

Yes, for now - we hope to figure out the problem.

Please consider to open a bug report with these findings.

best
Markus
_______________________________________________
grass-windows mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-windows
Markus Neteler

Re: No such file or directory

Reply Threaded More More options
Print post
Permalink
(cc grass-dev)

[r.in.poly fails to read text input file on Windows/CMD line]

On Fri, Aug 14, 2009 at 3:52 PM, Peter Brooks<[hidden email]> wrote:

> No, I think it is whitespace...  I'm trying to use the 'cmd >' field
> in the 'GRASS GIS Layer Manager' (the new wxPython GUI).  I guess
> this is what a Windows user would try to do :-)
>
> I tried adding a space to the folder name (= 'c:\nc external'),
> forward slashes don't help but speech or quote marks do.
>
> (I think the same thing happens with all r.in commands if they are
> looking for external files - is this to be expected?)
>
> Using the GRASS Command line utility (DOS shell type interface):
>
> GRASS 6.4.0svn (North-Carolina)> cd c:/nc external
> The system cannot find the path specified.
>
> GRASS 6.4.0svn (North-Carolina)> cd c:\nc external
> (works ok)

@devs:
Perhaps we need some more G_convert_dirseps_*() magic?

Markus
_______________________________________________
grass-windows mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-windows
Glynn Clements

Re: No such file or directory

Reply Threaded More More options
Print post
Permalink
In reply to this post by Peter Brooks-3

Peter Brooks wrote:

> No, I think it is whitespace...  I'm trying to use the 'cmd >' field
> in the 'GRASS GIS Layer Manager' (the new wxPython GUI).  I guess
> this is what a Windows user would try to do :-)
>
> I tried adding a space to the folder name (= 'c:\nc external'),
> forward slashes don't help but speech or quote marks do.
>
> (I think the same thing happens with all r.in commands if they are
> looking for external files - is this to be expected?)

If an option expects a filename, it will typically be passed directly
to open(), fopen() etc. If you supply a plain filename or a relative
path, it will be interpreted relative to the current directory (rather
than e.g. the mapset directory).

If an option value contains whitespace, it needs to be quoted
appropriately for the context in which it occurs.

In a Windows command prompt, you need to put double quotes around the
entire option=value argument.

In bash, you can use single or double quotes around the entire
argument or around the filename, or precede spaces by backslash
characters (also, you need to either use forward slashes as directory
separators or quote backslashes appropriately).

The command prompt in the wxPython GUI uses Python's shlex module (in
POSIX mode), which provides bash-like quoting:

http://docs.python.org/library/shlex.html#parsing-rules

Filenames entered elsewhere in the GUI shouldn't normally need to be
quoted.

Even with correct quoting, some shell scripts may not correctly handle
filenames containing spaces; this is part of the reason why shell
scripts have been replaced with Python scripts in GRASS 7.

--
Glynn Clements <[hidden email]>
_______________________________________________
grass-windows mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-windows
Peter Brooks-3

Re: [GRASS-dev] Re: No such file or directory

Reply Threaded More More options
Print post
Permalink
In reply to this post by Markus Neteler
The 'About' window says

GRASS GIS 6.4.0svn (2009)

GIS Library Revision 37101 (2009-05-10)

I downloaded and installed on 02-Aug.

Cheers
Peter


On 14 Aug 2009 at 16:54, Hamish wrote:

> [r.in.poly fails to read text input file on Windows/CMD line]

I have checked at the r.in.poly source code, the problem does
not seem to be there. The path is passed to fopen() verbatim.

what version/revision of 6.4.0svn is this? is it the latest?
ISTR that Martin&Glynn had fixed this -- wxGUI now uses a
python parser which understands shell quoting on the Cmd> line.
But that might only be present in the very latest build.


Hamish





_______________________________________________
grass-windows mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-windows