1. walk_dir for Linux

Found what I think is a bug in walk_dir for Linux. Tried the code in the
documentation and got this peculiar result:


euphoria/tutorial\append.ex: 1339
euphoria/tutorial\calc.ex: 653
euphoria/tutorial\celcius.ex: 999
euphoria/tutorial\example.ex: 1155
euphoria/tutorial\filesort.ex: 3460
euphoria/tutorial\getc.ex: 1553
euphoria/tutorial\gets.ex: 1749
euphoria/tutorial\hello.ex: 758
euphoria/tutorial\learn.ex: 2656
euphoria/tutorial\seqcalc.ex: 1032
euphoria/tutorial\simple.ex: 569

A mix of slashes and backslash, not what is expected I guess.

Regards
John

new topic     » topic index » view message » categorize

2. Re: walk_dir for Linux

John Rebert wrote:
> 
> Found what I think is a bug in walk_dir for Linux. Tried the code in the
> documentation
> and got this peculiar result:
> 
> 
> euphoria/tutorial\append.ex: 1339
> euphoria/tutorial\calc.ex: 653
> euphoria/tutorial\celcius.ex: 999
> euphoria/tutorial\example.ex: 1155
> euphoria/tutorial\filesort.ex: 3460
> euphoria/tutorial\getc.ex: 1553
> euphoria/tutorial\gets.ex: 1749
> euphoria/tutorial\hello.ex: 758
> euphoria/tutorial\learn.ex: 2656
> euphoria/tutorial\seqcalc.ex: 1032
> euphoria/tutorial\simple.ex: 569
> 
> A mix of slashes and backslash, not what is expected I guess.

The example in the documentation is meant for Windows/DOS.
It uses backslashes in look_at() and searches C:\MYFILES.
You should change the printf() statement in the example
from:
     printf(1, "%s\\%s: %d\n", ...
to:
     printf(1, "%s/%s: %d\n", ...

walk_dir() itself, in file.e, does not use backslash anywhere.
It uses SLASH, which is set to either backslash or forward
slash depending on platform().

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

3. Re: walk_dir for Linux

Yes, I see that now, sorry, stupid mistake.
John

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu