Selecting an application
Monte Goulding
monte at sweattechnologies.com
Tue May 6 22:55:01 EDT 2003
Perhaps you read the first 2 chars of the file and if it's not #! but it is
executable then it's an app????
Monte
-----Original Message-----
From: metacard-admin at lists.runrev.com
[mailto:metacard-admin at lists.runrev.com]On Behalf Of Yennie at aol.com
Sent: Wednesday, 7 May 2003 11:13 AM
To: metacard at lists.runrev.com
Subject: Re: Selecting an application
FWIW, there are definitely a fair number of scripts floating around which
_are_ executable but don't have a file extension. For example, most open
source project have a file named "configure". It should really be called
"configure.sh" (and you'll see #!/bin/sh on the first line)... but, well, it
isn't. On the other hand, I can't think of any binary executables that _do_
have extensions, but there's nothing stopping someone from creating one.
I'm fairly sure you'll get good results if you 1) check the executable bit
and then 2) examine the first few characters of the file to see if it is a
script. If you're adverse to using #2 to identify executable script files,
file extensions should work most of the time, but there's really no
guarantee that files will be named appropriately.
One thing to remember: if you try to peek at the first few bytes of files
to find scripts, make sure you have read privileges on that file first.
Also note that there are things such as ".dll" or ".a" or ".lib" which are
all considered executables but don't really fit the "application" sense.
That was the rule I was about to work with, but just to be safe: can you
think of any other file types in addition to apps that have no
extension?
------------------------------
Brian Yennie
Chief Technology Officer
QLD Learning, LLC
www.QLDLearning.com
PH: (904)-997-0212
EMAIL: Yennie at aol.com
-------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.runrev.com/pipermail/metacard/attachments/20030506/d76c7a6e/attachment.htm
More information about the metacard
mailing list