1. Euphoria file types

Please,where can I find info on Euphoria file tpyes? No help on google. The Search on "OpenEuphoria: Euphoria v4.0" isn't working. Thanks! ...Vern

new topic     » topic index » view message » categorize

2. Re: Euphoria file types

What do you mean file types?

Jeremy

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

3. Re: Euphoria file types

I think you want the reference manual. Or, for how to use files, try searching the archives for code examples at:

http://rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=file+type


useless

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

4. Re: Euphoria file types

vmars said...

Please,where can I find info on Euphoria file tpyes? No help on google. The Search on "OpenEuphoria: Euphoria v4.0" isn't working. Thanks! ...Vern

On this forum, click on "Manual",
scroll down to section 5.12, "I/O", click on "5.12 I/O",
scroll down to "5.12.2.6 open", click on it,
scroll down to "Possible modes are:"

That section should answer your questions.

Alternatively, for in my opinion WAY better documentation,
goto the regular Euphoria html doc section in your computer,

click on "refman.htm",
scroll down to the better described, "File and Device I/O ",
scroll down to the better described, "open - open a file or device ",

and the info there should also answer your questions.

Dan

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

5. Re: Euphoria file types

I think it is planned to keep the assignments in Windows:

.exw for exwc for the Windows version. and .ex for ex.exe DOS version.

The .e, .ew files are libraries and are not to be run. Do we want all general EUPHORIA files to be run on the DOS interpreter? Shall we make a distinction between DOS EUPHORIA program extensions and General EUPHORIA program extensions?

Perhaps we can leave it up to the user whether to use the Windows interpreter exwc for .ex programs or the DOS one in an install program.

Shawn Pringle

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

6. Re: Euphoria file types

I see it differently.

Extension Interpreter Reason
.ex exwc, exu console/server application
.exw exw, exu windowed (as in GUI, not as in Windows) application
.exd ex DOS application
.e - include file

My thinking on these lines is:

  1. DOS is the odd ball now. Maybe 10 years ago it was the standard, but times have changed. Yes, some people still use DOS but I can find 10,000 people who use Windows/Linux/OS X for every 1 that uses DOS.
  2. Euphoria is a cross platform language and is growing so even more. With 4.0 we now have OS X support.
  3. For those scripts that are platform dependent, do we really want the extension to indicate this? It has no enforcement. For instance, I can run exwu myfile.txt, or exw hello.ruby. As long as it's Euphoria code, Euphoria does not care about extension of the source file, so an extension enforces nothing. Further, do we really want ex=DOS, exw=Windows, exu=Unix/Linux, exfb=FreeBSD (it is different than Linux), exosx=OS X. Further, being cross a cross platform language, many of these applications could care less what platform they are running on.
  4. Euphoria scripts can easily check what platform they are running on and if they do not support OS X or they require Windows, then the application should state so in code, as the application executes.
  5. Many applications now use cross-platform GUI libraries. We have Gtk, wxWidgets, Iup and even EuQT (just a start, but it is already more functional than other languages Qt wrappings). These applications are "windowed" or "GUI" application but will run on Windows, Linux, FreeBSD and OS X w/o change.
  6. Euphoria, as far as I know, has been the only language to make the distinction of platform in their file extensions. For instance, you do not have luad (DOS), luaw (Windows), luao (OSX), luau (Unix), etc.. Nor rbd, rbw, rbo, rbu for Ruby, or pyd, pyw, ... for Python.
  7. We need to make some distinction because we have three interpreters on the Windows platform (DOS (ex), Console (exwc), No Console (exw)).

The above plan makes the standard extensions hit the widest target.

Jeremy

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

7. Re: Euphoria file types

jeremy said...

<snip>

Further, being cross a cross platform language, many of these applications could care less what platform they are running on.

<snip>

Jeremy

I disagree, they care so little about that that they couldn't care less.

useless

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

8. Re: Euphoria file types

jeremy said...

I see it differently.

Extension Interpreter Reason
.ex exwc, exu console/server application
.exw exw, exu windowed (as in GUI, not as in Windows) application
.exd ex DOS application
.e - include file

Jeremey:

I think that the include files should be.

.e - General include file
.ew - Windows only include file
.eu - Linux only include file


Bernie

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

9. Re: Euphoria file types

Bernie, what about FreeBSD only? OS X only? They are different and there will be includes that work only on FreeBSD or only on OS X. Further, what happens with 4.1 when we support AIX, Solaris and others? They also will have includes that only work on them. In fact, I may work a bit on making it work on Solaris before 4.0 final.

Then, we have another issue. What happens when we go to 64bit and this include only works on 64bit linux? .eu64? what if an include doesn't work on 64bit, .eu32 ? The list could go on and on. I do not think the extension should be the indication of what platform/environment the file will work on except in the case of which file is linked ex.exe, exwc.exe and exw.exe.

Jeremy

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

10. Re: Euphoria file types

Oh, I wanted to say, here's how an include should work:

ifdef !WIN32 then 
    crash("MyLib v1.0 only works on Windows 32") 
end ifdef 
 
-- code 
-- code 
-- code 

This is the only way of really doing what is the file needs to have done.

Jeremy

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

11. Re: Euphoria file types

I fully agree with the ideas you have put forward for the extensions and the reasons for them. Non MS OSes have only one interpreter so they fortunately don't need to worry about extensions. I think the Non-MS OSes work like exwc instead of exw.

Why do we have both an exw and exwc? Why not just have an option for when you want the interpreter to create a new console instead?

exwc foo.ex ( runs in the current console like ) exwc -nc foo.ex ( could be made to creates a new console )

exu foo.ex ( runs in current console ) exu -nc foo.ex ( opens a new console and runs foo.ex in it. )

And it is so inconsistent to have to put -CON in order to supress the creation of a new console Window on a translated application on one platform but then to not do so by default on the other.

Shawn Pringle

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

12. Re: Euphoria file types

SDPringle said...

I fully agree with the ideas you have put forward for the extensions and the reasons for them. Non MS OSes have only one interpreter so they fortunately don't need to worry about extensions. I think the Non-MS OSes work like exwc instead of exw.

Why do we have both an exw and exwc? Why not just have an option for when you want the interpreter to create a new console instead?

Windows stupidity. The PE header has a stub that specifies whether it is an app that uses the console subsystem or the gui subsystem. You can't switch between the two dynamically, it has to be choosen at load time. (It is possible to achieve this by writing your own stub. This is low level enough that you can't use the C library to help you here.)

A console subsystem app can't tell if it was started from another console or if it was given a brand new one. It just sees a console, and thats it. A gui subsystem app can't tell if it was started from a console or not. It just sees no console, and will have to create a new one using AllocConsole().

To be perfectly clear:

There is no way to start a console subsystem app without a console. If its not given one to share by the parent, it creates a new one. Whether you want it to or not.

There is no way to share the parent process's console with a gui subsystem app. If it wants a console, it has to make a new one. (XP and later can use AttachConsole() but this has its own disadvantages, such as having to deal with two apps reading the console input simulatenously.)

SDPringle said...

exwc foo.ex ( runs in the current console like ) exwc -nc foo.ex ( could be made to creates a new console )

I think exwc -nc could be made to work, by having it be a console subsystem app but then call FreeConsole() to release it and then calling AllocConsole() again to create a new one. Of course, if exwc was called from a GUI app that had no console (e.g. Start->Run) then we'll see a flicker as the default console is destroyed before its replacement is created.

SDPringle said...

exu foo.ex ( runs in current console ) exu -nc foo.ex ( opens a new console and runs foo.ex in it. )

Huh? What is a "new console" for exu?

SDPringle said...

And it is so inconsistent to have to put -CON in order to supress the creation of a new console Window on a translated application on one platform but then to not do so by default on the other.

Shawn Pringle

Only one platform supports the concept of console windows. Other platforms handle this saner, so the issue doesn't need to arise there.

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

13. Re: Euphoria file types

jeremy said...

Oh, I wanted to say, here's how an include should work:

ifdef !WIN32 then 
    crash("MyLib v1.0 only works on Windows 32") 
end ifdef 
 
-- code 
-- code 
-- code 

This is the only way of really doing what is the file needs to have done.

Jeremy

Why introduce a new symbol "!", when Euphoria already has the keyword "not" for this purpose?

Rob

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

14. Re: Euphoria file types

robcraig said...

Why introduce a new symbol "!", when Euphoria already has the keyword "not" for this purpose?

Rob

We'd need to make it clear that the keywords 'or' and 'and' do not work between an ifdef....then

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

15. Re: Euphoria file types

jimcbrown said...
robcraig said...

Why introduce a new symbol "!", when Euphoria already has the keyword "not" for this purpose?

Rob

We'd need to make it clear that the keywords 'or' and 'and' do not work between an ifdef....then

Why not document that fact for now, and leave open the possible future support of "or" and "and"?

Rob

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

16. Re: Euphoria file types

robcraig said...

Why introduce a new symbol "!", when Euphoria already has the keyword "not" for this purpose?

I'll change it to read not. You are right.

Jeremy

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

17. Re: Euphoria file types

Oops, By 'file types' I mean 'file extensions'.


From this Forum I got:
.ex exwc, exu console/server application .exw exw, exu windowed (as in GUI, not as in Windows) application .exd ex DOS application .e - include file .exw for exwc for the Windows version. and .ex for ex.exe DOS version.


From DOCS:
"CON" - the console (screen) "AUX" - the serial auxiliary port "COM1" - serial port 1 "COM2" - serial port 2 "PRN" - the printer on the parallel port "NUL" - a non-existent device that accepts and discards output Close a file or device when done with it, flushing out any still-buffered characters prior.


From DOCS:
"r" - open text file for reading "rb" - open binary file for reading "w" - create text file for writing "wb" - create binary file for writing "u" - open text file for update (reading and writing) "ub" - open binary file for update "a" - open text file for appending "ab" - open binary file for appending


I finally did find the following at:
http://openeuphoria.org/docs/eu400_0009.html#_34_Euphoriaprograms
2.1.5 Running a Program To run a Euphoria program you type the name of the interpreter followed by the filename of the program you want to run. Such as: ex example.ex What you just typed is known as the command-line. Depending on the platform you are using the interpreter could be called:
ex
exw
exwc
exu
The command-line may contain extra information. Following your program filename you may add extra words (known as arguments) that can used in your program to customize its behavior. These arguments are read within your program by the built-in function command_line(). Optionally, you may also use command line switches that are typed between the interpreter name and the program name. Command line switches customize how the interpreter itself behaves. Unlike many other compilers and interpreters, there is no obligation for any special command-line options for ex, exw or exu. Only the name of you Euphoria file is expected, and if you don't supply it, you will be prompted for it. The DOS32 version of the Euphoria interpreter is called ex.exe. The WIN32 version is called exw.exe and the WIN32 console version is called exwc.exe. The Linux/FreeBSD version is called exu. Euphoria is forgiving about your choice of file extensions. By convention, main Euphoria files have an extension of .ex, .exw, or .exu. Other Euphoria files, that are meant to be included in a larger program, end in .e or sometimes .ew or .eu. To save typing, you can leave off the ".ex", and the ex command will supply it for you automatically. exw.exe will supply ".exw", and exu will supply ".exu". Each will try the other possible extensions as well if the default fails. If the file can't be found in the current directory, your PATH will be searched (using the most likely extension, then the others). You can redirect standard input and standard output when you run a Euphoria program, for example: ex filesort.ex < raw.txt > sorted.txt or simply, ex filesort < raw.txt > sorted.txt
Under Windows, you will need to use Start -> Run... facility if you need to enter command line switches or other arguments to a .exw program.
For frequently-used programs under DOS/Windows you might want to make a small .bat (batch) file, perhaps called myprog.bat, containing two statements like:
@echo off
ex myprog.ex %1 %2 %3 %4 %5 %6 %7 %8 %9
The first statement turns off echoing of commands to the screen. The second runs ex myprog.ex with up to 9 command-line arguments. See command_line() for an example of how to read these arguments. Having a .bat file will save you the minor inconvenience of typing ex (or exw) all the time; i.e., you can just type: myprog instead of: ex myprog Unfortunately DOS will not allow redirection of standard input and output when you use a .bat file. However, this works in a Windows DOS box. Under Linux/FreeBSD, you can type the path to the Euphoria interpreter on the first line of your main file, e.g. if your program is called foo.exu:

  1. !/home/rob/euphoria/bin/exu procedure foo() ? 2+2 end procedure foo() Then if you make your file executable: chmod +x foo.exu You can just type: foo.exu to run your program. You could even shorten the name to simply "foo". Euphoria ignores the first line when it starts with #!. Be careful though that your first line ends with the Linux/FreeBSD-style \n, and not the DOS/Windows-style \r\n, or the Linux/FreeBSD shell might get confused. If your file is shrouded, you must give the path to backendu, not exu. You can also run bind.bat (DOS32), or bindw.bat (WIN32) or bindu (Linux/FreeBSD) to combine your Euphoria program with ex.exe, exw.exe or exu, to make a stand-alone executable file (.exe file on DOS/Windows). With a stand-alone .exe file you can redirect standard input and output. Binding is discussed further in Distributing a Program. Using the Euphoria to C Translator, you can also make a stand-alone .exe file, and it will normally run much faster than a bound program. exu, ex.exe, exw.exe and exwc will be in the euphoria\bin directory which must be on your search path. The environment variable EUDIR should be set to the main Euphoria directory, e.g. c:\euphoria. 2.1.6 Running under Windows You can run Euphoria programs directly from the Windows environment, or from a DOS shell that you have opened from Windows. By "associating" .ex files with ex.exe, and .exw files with exw.exe you can simply double-click on a .ex or .exw file to run it. Under Windows you would define a new file type for .ex, by clicking on My Computer / view / options / file types. It is possible to have several Euphoria programs active in different windows. If you turn your program into a .exe file, you can simply double-click on it to run it.
new topic     » goto parent     » topic index » view message » categorize

18. Re: Euphoria file types

jeremy said...

Many applications now use cross-platform GUI libraries. We have Gtk, wxWidgets, Iup and even EuQT (just a start, but it is already more functional than other languages Qt wrappings).

We have a QT wrapper somewhere? I've not seen it ... your post is the only reference to Euphoria and QT that I can find.

Craig

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

19. Re: Euphoria file types

CraigWelch said...
jeremy said...

Many applications now use cross-platform GUI libraries. We have Gtk, wxWidgets, Iup and even EuQT (just a start, but it is already more functional than other languages Qt wrappings).

We have a QT wrapper somewhere? I've not seen it ... your post is the only reference to Euphoria and QT that I can find.

probably jeremy didn't want to announce it untill it has some more testing and wrapping, but since he let it slip.

I found this accidentally the other morning, qt euphoria wrapping proof of concept. euqt svn

should work with any recent euphoria version 4.x
also need Qt 4.x or 4.5 source or binaries from http://www.qtsoftware.com

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

Search



Quick Links

User menu

Not signed in.

Misc Menu