> I feel really enthusiastic at the thought of a Freenet client in C that > compiles on Windows and Unix (perhaps Mac as well). Keep it up.
I definitely feel the same way... > Also, differences in file path syntax: Unix: /dir1/dir2/../dirn/filename, > Windows: C:\dir1\dir2\..\dirn\filename.ext I believe java has a canonical representation for this. The app uses the canonical way to represent the path, the JRE translates this then to the Operating system, I guess we need more of that ;-) ----- Original Message ----- From: "David McNab" <[email protected]> To: <devl at freenetproject.org> Sent: Friday, April 27, 2001 12:20 PM Subject: Re: [freenet-devl] YAEFNIIC > From: "Frank Joppe" <drnomad at zonnet.nl> > > > > > 2) How would you rate your code for platform-independence and > portability, > > > especially to platforms like Windoze? > > > > Interesting question, how about the difference between PC (Intel) and > Apple > > (Motorola)? big/low endian... you can trust a protocol-complience on one > > machine, but can you trust it on another? > > As long as there's a layer of functions which converts numeric fields within > a data stream into the machine's internal representation of numbers, and > back again, big endian versus little endian shouldn't be a problem. Taking > care of pointer arithmetic behaviour between platforms as well, of course. > > The bigger issues come up with operating system facilities, like files and > sockets. > > For instance, in *nix, sockets are treated much like file descriptors, and > are compatible with file functions such as open(), close(), read(), write(), > fdopen() etc. But in windoze, there are separate socket primitives - send(), > recv() etc. Also, WSAStartup() must be called before any sockets are used. > Also, differences in file path syntax: Unix: /dir1/dir2/../dirn/filename, > Windows: C:\dir1\dir2\..\dirn\filename.ext > Also, line terminators for text files: Unix: \n, Windows: \r\n > And so on. > > A very good example of portable code is the Junkbusters proxy, at > http://www.junkbusters.com/ijb.html > > I feel really enthusiastic at the thought of a Freenet client in C that > compiles on Windows and Unix (perhaps Mac as well). Keep it up. > > Cheers > David > > > > > > ----- Original Message ----- > > From: "David McNab" <david at rebirthing.co.nz> > > To: <devl at freenetproject.org> > > Sent: Friday, April 27, 2001 4:59 AM > > Subject: Re: [freenet-devl] YAEFNIIC > > > > > > > From: "Kalle A. Sandstr"om" <ksandstr at iki.fi> > > > > > > >Right. I've written a deeply hackerware experimental freenet node > > > >implementation (in C) -- currently it can connect to the 'testserver' > > > > > > Two questions: > > > > > > 1) How do you rate the prospect of you keeping it protocol-compatible > with
