[Ecls-list] Load and filenames.

Waldek Hebisch hebisch at math.uni.wroc.pl
Fri May 30 17:09:47 UTC 2008

Juan Jose Garcia-Ripoll wrote:
> On Fri, May 30, 2008 at 6:06 PM, Waldek Hebisch
> <hebisch at math.uni.wroc.pl> wrote:
> > Apparently, if file extension is unknown to 'load' it treats file
> > as a Lisp file.  It would be nice if 'load' could decide file type
> > based on content...
> Simply put, I do not know how to code this in a portable way. Seems
> like one should track all the magic file IDs of binary files on all
> platforms where ECL could potentially be built.
> Hmm, the only serious alternative I can think of is using the Unix
> command "file" and interpreting its output to decide whether the
> binary is executable (and hence fasl) or text (and hence potentially
> lisp source).

Presumably ECL can decide if a file is Lisp source or not.  If it
is not a Lisp source than it is a fasl or invalid file.  I would
think that 'dlopen' (or equivalent) can report to ECL errors
due to loading of invalid binaries.

In other words, why not try to load in both ways and report errors
only if none works?

                              Waldek Hebisch
hebisch at math.uni.wroc.pl 

More information about the ecl-devel mailing list