Re: Missing library

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Mon, 12 Jul 2004 16:21:35 -0700, rudy toews
<guest at RapidEuphoria.com> wrote:

>Robert Craig wrote:
>> Tommy Carlier wrote:
>> > You sometimes download a program or library, just to find out some library
>> > is missing.
>> > Wouldn't it be nice if there was some kind of search engine where you type
>> > in a filename
>> Yes.
>> I'll think about this after the release.
>> I guess you could locate the .zips (.tars, etc.) that contain
>> a certain file. You'd then have to use your judgment
>> to determine which zip had the definitive, latest and
>> greatest version of a library.
That will be handy.

<snip>
>the idea:
>a: 
>a user can profile their system, 
<snip>
Thinking out loud here, I'd like to see a program self-verify it has
the correct/expected/supported include files.

I'm thinking eg:

	constant validate_self=0, checksum=#00000000
	procedure validate()
	integer c
		c=read_file_and_build_checksum()
		if validate_self then
			if c!=(checksum) then
				error("wrong version of ...")
				abort(1)
			end if
		else
			seek(24?)
			printf(1,"1,checksum=#%08x",c)
			puts(1,"new checksum generated")
		end if
	end procedure
	validate()

The idea is that the programmer (manually) edits validate_self to 0,
tests the program, then ships the automatically-self-modified files.

Thoughts anyone?
Pete

PS You could also ([1] see below) have eg:

include selftest.e
--nclude w0591.ew
include w0592.ew
--nclude w0600.ew
--nclude win32lib.ew

and each time it runs it patches a "--" with "in" at random, except
for the final release when it leaves it as win32lib.ew
Admittedly, in the case of win32lib, checking the value of
Win32LibVersion (against a table of allowed values) is obviously much
better than a crc, but you don't necessarily have that luxury on all
third party components your app uses.

 [1] I don't really rate the idea of supporting multiple versions of a
lib, but this self-verify idea may need to be a bit more general
purpose than my or anyone else's specific needs. I daresay this random
patching could easily cause severe programmer difficulties, such is
the burden of supporting multiple lib versions.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu