executable extensions

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
User avatar
bloodhound23
Member
Member
Posts: 115
Joined: Wed Jan 23, 2008 7:13 pm
Contact:

executable extensions

Post by bloodhound23 »

This is kind of a random thought on my mind at the moment, really pointless but I thought I'd ask. Does anybody have any conventions that they are using to name executables in their OS or will be using?
mine:
.fex-Flat executable
.cex-Crutch executable
of course I'll have elf etc.

By the way the Crutch operating system is under way!!! :D
I thought I wasn't thinking, I thought wrong.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post by Brynet-Inc »

Unix-like operating systems don't typically use file extensions for binaries... configuration files often do, but they're not held back by that weird DOS/Windows 3-letter rule.. ;)
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
mathematician
Member
Member
Posts: 437
Joined: Fri Dec 15, 2006 5:26 pm
Location: Church Stretton Uk

Post by mathematician »

Brynet-Inc wrote:Unix-like operating systems don't typically use file extensions for binaries... configuration files often do, but they're not held back by that weird DOS/Windows 3-letter rule.. ;)
No 3 letter rule in Windows; although it is still conventional. You can have pretty much as many letters as you want in an extension. (Who cares what Unix does?)
User avatar
piranha
Member
Member
Posts: 1391
Joined: Thu Dec 21, 2006 7:42 pm
Location: Unknown. Momentum is pretty certain, however.
Contact:

Post by piranha »

No 3 letter rule in Windows; although it is still conventional. You can have pretty much as many letters as you want in an extension. (Who cares what Unix does?)
Because (for me) that system is very easy to deal with.

-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
User avatar
Telgin
Member
Member
Posts: 72
Joined: Thu Dec 20, 2007 1:45 pm

Post by Telgin »

I haven't decided on how to handle it in my OS yet. More specifically, I haven't decided if my OS will require file extensions. The file system I've arrived on doesn't, and really the OS model I've arrived at shouldn't. That leaves the command line interpreter to sort out, and I'm still not sure.

I plan on having files as being marked as executable or not in the file system, so ultimately it shouldn't be necessary. Since I used Windows pretty much exclusively up until a half a year ago (and was introduced by force to Linux by my university's computer science department), I'll probably end up using the convention anyway. No limit on the length of the extension, and there probably won't be any sort of file type association anyway.

I'm lazy in this respect and since I don't need to support complicated scenarios like PE and ELF executables in the same OS, I'll probably just use Windows standard convention.

.bin or .exe for executable files (haven't decided)
.sys for system files (what exactly are these anyway, OS-use DLLs?)
.dll / .lib for dynamically / statically linked libraries

Then again, I might do something a little more extravagant, but I don't know.
User avatar
piranha
Member
Member
Posts: 1391
Joined: Thu Dec 21, 2006 7:42 pm
Location: Unknown. Momentum is pretty certain, however.
Contact:

Post by piranha »

How about:
.run or .prog for executables.

And you enter it into the command prompt without or with the extension, and it finds it.

-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
xyzzy
Member
Member
Posts: 391
Joined: Wed Jul 25, 2007 8:45 am
Libera.chat IRC: aejsmith
Location: London, UK
Contact:

Post by xyzzy »

mathematician wrote:No 3 letter rule in Windows; although it is still conventional. You can have pretty much as many letters as you want in an extension. (Who cares what Unix does?)
For executables, there needs to be .exe, otherwise explorer/cmd won't execute it. Although the lower level of the system probably doesn't actually care.

Anyway, my OS does what UNIX does, no extensions on binaries.
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post by AJ »

Hi,

I don't plan to support flat binaries, so don't need a file extension from that point of view. Generally, I would like to forget about file extensions for most structured file types (although this does mean scanning the file for format before choosing the appropriate action for a particular file type).

Cheers,
Adam
User avatar
ucosty
Member
Member
Posts: 271
Joined: Tue Aug 08, 2006 7:43 am
Location: Sydney, Australia

Post by ucosty »

You could store the file type in an attribute like Mac OS pre X
The cake is a lie | rackbits.com
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post by Solar »

I wouldn't use extensions for executables, because it poses a dilemma.

You execute not only executables, you execute scripts, too.

Naming your scripts "*.exe" is wrong, because a script can be edited, an executable cannot.

Naming your scripts "*.script" or something is pretty arbitrary, and doesn't add much usefull information.

Naming your scripts with a "language wart" ("*.py" or "*.pl" or "*.sh" or "*.rexx" or whatever) isn't very helpful either, because why should you have to remember what language your script "prime" is written in, just to be able to call it?

I think Unix got it right there - something executable either starts with "ELF" (binary .exe), or with "#!{interpreter}", which tells the shell (and the editing programmer) what language it is in, without bothering the end user.

Unfortunately, not only is the {interpreter} part not constant across Unix flavors (e.g. /bin/bash vs. /usr/bin/bash), no, all-too-many scripts still carry around "language warts", which effectively defeats the purpose.
Every good solution is obvious once you've found it.
User avatar
Wave
Member
Member
Posts: 50
Joined: Sun Jan 20, 2008 5:51 am

Post by Wave »

While I'm not sure about whether to have extensions or not, I can say for sure that Solar's argumentation isn't right.
You execute not only executables, you execute scripts, too.
In the Unix world, you do. In the Windows world, you don't. You execute an executable which then executes the script.
Naming your scripts "*.exe" is wrong, because a script can be edited, an executable cannot.

Naming your scripts "*.script" or something is pretty arbitrary, and doesn't add much usefull information.
I agree with that.
Naming your scripts with a "language wart" ("*.py" or "*.pl" or "*.sh" or "*.rexx" or whatever) isn't very helpful either, because why should you have to remember what language your script "prime" is written in, just to be able to call it?
On Windows, there is a list of "auto-extensions" (by default it includes exe and bat). When you want to run hello.bat you just type hello. That could be used for any number of language extensions. To call print.rexx you just type print. The shell then finds print.rexx, then it finds the rexx interpreter (associated with .rexx files) and runs it.
Conway's Law: If you have four groups working on a compiler, you'll get a 4-pass compiler.
Melvin Conway
User avatar
inflater
Member
Member
Posts: 1309
Joined: Thu Sep 28, 2006 10:32 am
Location: Slovakia
Contact:

Post by inflater »

Binaries for PortixOS had extension firstly .PXE, and then .PES (Preliminary Executable System), but I think the name "Primitive Executable Support" would be more better... :lol:
"pes" stands in Slovak for "dog".
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English :P)
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post by Solar »

Wave wrote:While I'm not sure about whether to have extensions or not, I can say for sure that Solar's argumentation isn't right.
You execute not only executables, you execute scripts, too.
In the Unix world, you do. In the Windows world, you don't. You execute an executable which then executes the script.
Effectively you do this on Unix, too. ("./myScript.pl" and "perl ./myScript.pl" are effectively identical.)
Naming your scripts with a "language wart" ("*.py" or "*.pl" or "*.sh" or "*.rexx" or whatever) isn't very helpful either, because why should you have to remember what language your script "prime" is written in, just to be able to call it?
On Windows, there is a list of "auto-extensions" (by default it includes exe and bat). When you want to run hello.bat you just type hello.[/quote]

Which allows the end user to ignore the language wart while he types, but still adds information to "user space" that a user (at best) doesn't care about and (at worst) gets confused about.

On the other hand I freely admit that a language wart would allow for speedy ordering of scripts by implementation language. Hm. It's not such a clear-cut decision after all.
To call print.rexx you just type print. The shell then finds print.rexx, then it finds the rexx interpreter (associated with .rexx files) and runs it.
...and gets confused if there is a print.pl and a print.py as well... nah, I'm still opposed to language warts.
Every good solution is obvious once you've found it.
User avatar
01000101
Member
Member
Posts: 1599
Joined: Fri Jun 22, 2007 12:47 pm
Contact:

Post by 01000101 »

I like file extensions and associations. It gives a clear definition (at first glance) of what the file is... also with the association, icons are another great way to make certain files stand out or show their association.

The 3-char extension is just common practice, and not a rule. Although, have a +3 char extension can just look really messy. Most abbreviations are < ~3, so it seems natural to use that.
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

R.e. "language warts" - I use them for all scripts which are not meant to be run from the shell. For example, script A is run from the shell and calls script B - script A would have the executable flag set, and no extensions, and script B wouldn't be executable, and have a language extension.

I also use them for use with old versions of crappy version control systems which don't handle chmod's very well (*cough* CVS *cough*) - it gives me a hint as to how to run the script!
Post Reply