FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

New loader for DDL

 
Post new topic   Reply to topic     Forum Index -> DDL - D Dynamic Libraries
View previous topic :: View next topic  
Author Message
DRK



Joined: 18 Apr 2006
Posts: 11

PostPosted: Sat Oct 07, 2006 2:12 pm    Post subject: New loader for DDL Reply with quote

Hi there, I hope this is the right board to be posting this in.

I've been watching DDL for a while now, and decided that I wanted to try implementing a new loader to fix the problem of having to ship the host executable with a .MAP file. The loader works by tacking an arbitrary object file to the end of the executable along with a small header. That way, the host can be made effectively "self-contained", and

Code:
blah.loadAndRegister("foo.map");


Becomes [1]

Code:
blah.loadAndRegister(args[0]);


It's all working fine so far; I have the utility program to embed and extract the object files working. It's just that the loader doesn't work with DDL itself.

The problem appears to be that when DDL passes the loader the FileBuffer object, the buffer is empty. I've been at this for about three days, and I still cannot see any way to seek to the end of the file (which is what I need to do).

I will avoid using heavy-handed proclamations here (such as: Mango has the single worst designed IO library I've ever seen Razz) and stick to: does anyone have any ideas? I read a comment in the FileBuffer source about reading the whole file in before passing to the loaders; any update on that?

Failing that, is there any way to "seek" with a FileBuffer?

And failing that... would it be poor form to simply force the buffer to read the whole damn file in manually? (If so, I'll have to work out *how* to do that).

At any rate, I love the work you're doing, and hope I can be of help.

[1]: Yes, I realise that arg[0] is a very naïve way of doing this, but it suffices for the example Razz
Back to top
View user's profile Send private message
larsivi
Site Admin


Joined: 27 Mar 2004
Posts: 453
Location: Trondheim, Norway

PostPosted: Sat Oct 07, 2006 3:40 pm    Post subject: Re: New loader for DDL Reply with quote

DRK wrote:
Hi there, I hope this is the right board to be posting this in.


Certainly is Smile

DRK wrote:

The problem appears to be that when DDL passes the loader the FileBuffer object, the buffer is empty. I've been at this for about three days, and I still cannot see any way to seek to the end of the file (which is what I need to do).

I will avoid using heavy-handed proclamations here (such as: Mango has the single worst designed IO library I've ever seen Razz) and stick to: does anyone have any ideas? I read a comment in the FileBuffer source about reading the whole file in before passing to the loaders; any update on that?

Failing that, is there any way to "seek" with a FileBuffer?


I would suggest that you try the classes DDLReader and/or DDLWriter which should allow you to seek.

As for mango.io, flexibility, power and efficiency is in the driving seat there, and I know you'll be hard pressed to find anything better in that respect. As for ease of use, it's usually just a matter of finding the correct abstraction level for your problem. Moving from std.stream to mango.io was a no-brainer.
Back to top
View user's profile Send private message
DRK



Joined: 18 Apr 2006
Posts: 11

PostPosted: Sat Oct 07, 2006 11:51 pm    Post subject: Re: New loader for DDL Reply with quote

larsivi wrote:
...
DRK wrote:
...

Failing that, is there any way to "seek" with a FileBuffer?

I would suggest that you try the classes DDLReader and/or DDLWriter which should allow you to seek.

Ok, I'll give it a shot. Thanks for the advice.

larsivi wrote:
As for mango.io, flexibility, power and efficiency is in the driving seat there, and I know you'll be hard pressed to find anything better in that respect. As for ease of use, it's usually just a matter of finding the correct abstraction level for your problem. Moving from std.stream to mango.io was a no-brainer.

(Must... resist... urge to... go... on... tirade... nnng)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DDL - D Dynamic Libraries All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group