1. Scanning a directory an getting file names.

Does anybody know how to do this?

new topic     » topic index » view message » categorize

2. Re: Scanning a directory an getting file names.

Fendaril said...

Does anybody know how to do this?

See dir.

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

3. Re: Scanning a directory an getting file names.

Fendaril said...

Does anybody know how to do this?

include std/filesys.e 
include std/pretty.e 
 
pretty_print(1, dir("/"), {3}) 

You can look at Directory Handling in the manual for more information on what dir() actually returns.

Jeremy

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

4. Re: Scanning a directory an getting file names.

thanks. is my euphoria installation valid? it says it cannot find std/filesys.e when i try to run it.

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

5. Re: Scanning a directory an getting file names.

Fendaril said...

thanks. is my euphoria installation valid? it says it cannot find std/filesys.e when i try to run it.

Is your EUDIR set? Also, please give the output of eui -version. Did you install from one of the installers? At the end it asks if you wish to update the environment (an option). This is turned off by default during the beta stages as to not convert anyone's machine to 4.0beta while they still want to have 3.x. If this is the case, maybe you'd be best off reinstalling and making sure that you tell the installer to update your environment.

Jeremy

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

6. Re: Scanning a directory an getting file names.

jeremy said...
Fendaril said...

thanks. is my euphoria installation valid? it says it cannot find std/filesys.e when i try to run it.

Is your EUDIR set?

Even better, create a eu.cfg file.

Matt

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

7. Re: Scanning a directory an getting file names.

jeremy said...
Fendaril said...

thanks. is my euphoria installation valid? it says it cannot find std/filesys.e when i try to run it.

Is your EUDIR set?

Jeremy! Please stop recommending this archaic system!

eu.cfg FTW!

Unless Fendaril is using Euphoria 3.x. grin

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

8. Re: Scanning a directory an getting file names.

mattlewis said...

Even better, create a eu.cfg file.

I wonder if we should be shipping with a eu.cfg file. Seems to make the most sense.

Jeremy

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

9. Re: Scanning a directory an getting file names.

euphoric said...

Jeremy! Please stop recommending this archaic system!

eu.cfg FTW!

It's easy, that's why I suggest it. With the file, you may put it in the wrong place, it may not find it, etc... set EUDIR is (almost) fool proof (not that you're a fool Fendaril!), just saying, it's easy.

Jeremy

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

10. Re: Scanning a directory an getting file names.

jeremy said...
mattlewis said...

Even better, create a eu.cfg file.

I wonder if we should be shipping with a eu.cfg file. Seems to make the most sense.

Linux packages will. And, yes, the windows installer should, too. It should be simple, merely pointing to wherever the include directory is.

Matt

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

11. Re: Scanning a directory an getting file names.

The output of eui-version is 4.0.0 beta 2. Maybe its the cfg issue?

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

12. Re: Scanning a directory an getting file names.

Fendaril said...

The output of eui-version is 4.0.0 beta 2. Maybe its the cfg issue?

Create a file in the same place as the binary name eu.cfg, and add into it:

-i /dir/to/euphoria/include 

Or, type:

SET EUDIR=C:\dir\to\euphoria 

Jeremy

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

13. Re: Scanning a directory an getting file names.

yes problem solved.

I had to add this to a binary cfg:

-i C:\euphoria-40b2\include\std

-i C:\euphoria-40b2\include

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

14. Re: Scanning a directory an getting file names.

Fendaril said...

yes problem solved.

I had to add this to a binary cfg:

-i C:\euphoria-40b2\include\std

-i C:\euphoria-40b2\include

The first really shouldn't be there. The 4.0 standard is to use:

include std/regex.e 
include std/text.e 
... etc ... 

Thus, only the second should exist. -i c:\euphoria-40b2\include. This allows you to use most 3.x code found on the net and new 4.x code as well.

Jeremy

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

Search



Quick Links

User menu

Not signed in.

Misc Menu