Re: [Registry] change
Brought to you by:
aviram
|
From: Avi A. <avi...@gm...> - 2004-10-18 22:36:12
|
Tomorrow I have 2 hours flight, and few more hours to look at this problem. I'll come up with a solution. About the binary encoding/decoding stuff, folks, let me tell you I'd also prefer to just fwrite it, but I participated in some discussions in the early early days of Elektra (when I was still using Berkeley DB), and users blamed me hard regarding non-human-editable binary sandboxes, so the purpose is to have 100% plain text values, and put a lot of warnings in documentation that UNIX sysadmins do not like to handle binary configurations, and discourage its use. Read this: http://www.faqs.org/docs/artu/ch05s01.html (by Eric Raymond) http://www.orkut.com/CommMsgs.aspx?cmm=141&tid=64 (there are a lot of flames there) This encode/decode subject is still an open discussion, and I ask you to share your ideas. Regards, Avi On Mon, 18 Oct 2004 22:10:26 +0200, Jens Andersen <ra...@sk...> wrote: > ----- Original Message ----- > From: "Markus Raab" <mai...@gm...> > To: <reg...@li...> > Sent: Monday, October 18, 2004 9:39 PM > Subject: Re: [Registry] change > > <snip> > > >> When it's read back in and unencode is called the data passed there is > >> simply 190 (and seemingly some garbage data as well). This could possibly > >> be the problem? > > > > Can you post me the code how to read it to get any value back? > > I just added printf's in various parts of the the kdb library code ;) > The purpose was mainly to find out if the actual reading or if it was the > encoding function that messed things up. > (In the end I found that it seems to be encoding/saving the data that is the > problem. The resulting data contains weird symbols and stuff) > > > >> Tbh, i'm not sure if you can even just convert it back and set it the way > >> the code does? (from further investigation it seems you can't..It gives > >> some really weird results) > > > > Maybe best will be to cut off the encoding for binary values. It does not > > make > > sense anyway and does not work. Or can you repair that avi? > > I agree. It's quite likely to work better if we completely cutoff encoding > the data. > Just simply fwrite it after writing the DATA signature stuff... > And then when reading simply use fread to get it back :) (i.e. actually read > till EOF and not just till end of string) > the actual conversion code has some problems atm, in particular casting to > unsigned char...with ints that means it goes quite bad and ends up with a > weird value when used. Basically it's going to be hard to get it working for > all types while still encoding it...(unless you fwrite it to memory first, > then encode the resulting data and then go on from there...? Not sure if > that would work at all...Seems easier to just not encode ;)) > > Regards, > Jens Andersen > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal > Use IT products in your business? Tell us what you think of them. Give us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > Registry-list mailing list > Reg...@li... > https://lists.sourceforge.net/lists/listinfo/registry-list > |