zip support

Discussion around programming R'n'D, its source code and its tools.

Moderators: Flumminator, Zomis

HerzAusGold
Posts: 362
Joined: Sun Sep 25, 2005 4:41 pm
Location: Germany

Post by HerzAusGold »

Last post is from me. HerzAusGold
- I want to throw away my wlan. but I need it to write this

*edit*
Ah, I forgot.
In winuae "zfile.c" is a very good example for transparent zip,gz,dms ... files. The main thing is to prepare your code... But...
You mentioned that it is possible without coding, hook the IO layer.
(the zip files are like dirs)
In Unix too?
Hm then this is new to me. I dig into the web and find it out.

btw: Credits to the authors of unzip and winuae.
And the answer is ... 42 !
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Post by Holger »

> Now I am sure this is the right forum for me.

I'm pleased to hear this! :-)

> But Microsoft dont allow C-Files which are not compilable for its own

Oops... Yes, this is a bit dirty maybe. I automatically created some parts of the code and just included these parts into the corresponding source files.
Probably it's easily possible to change this into compilable .c files...

> So,where are your scripts or/and the data you get this files from??

The src/conf_*.[ch] files are indeed generated by a Perl script which is not part of the main distribution package. I don't know why exactly I excluded them, probably because they aren't needed for running or recompiling, but of course they are needed for modifying certain parts of the code. So I will include my "Scripts" directory into the next release version. And I'll manually add the scripts to the next 3.2.0-5 pre-release package, which I expect to release in a few days. :-)

> In winuae "zfile.c" is a very good example for transparent zip,gz,dms ...
> files. The main thing is to prepare your code... But...

Good point and thank you for this example -- if I should ever start adding transparent zip file support, I'll start with that one! :-)

And if it's really that easy (just wrapping my file accesses), I might add it even sooner than later. :)

> You mentioned that it is possible without coding, hook the IO layer.
> (the zip files are like dirs)
> In Unix too?

Yes, at least theoretically (which means that I don't know examples which already do that). Windows XP does something similar in the Windows Explorer as you probably know, but hasn't extended this to the general file I/O for other programs (which is really a bad idea, because you can, for example, start R'n'D directly from an unextracted zip archive through the Windows Explorer, but R'n'D then doesn't find its files and barfs).

To do something like that in Unix, you would write a library that wraps the usual file I/O (like fopen, fread, ...) and then run your (unmodified) application with that library, causing your application to use the functions in your library instead of using them from libc. Currently I don't recall the correct term for this technique, so I can't Google for some helpful resources, but I have done this years ago within a university project)...

> btw: Credits to the authors of unzip and winuae.

Yeah! Great pieces of open source software! :-)
Tomi
Posts: 339
Joined: Wed Aug 03, 2005 3:37 pm
Location: Slovakia

Post by Tomi »

KDE (under Unix) has also a fully wrapped file access, but it's really bad idea to make RnD dependant on KDE libs. The best solution should be single multiplatform code not depending on any system/external libs. The problem is - I don't know about any... :|
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Post by Holger »

> [...] it's really bad idea to make RnD dependant on KDE libs.

Exactly true!

I have to include this into the native R'n'D code base to have it working on all platforms. Currently, thera are only either X11 lib dependencies (and libc, of course ;-) ), or SDL dependencies, which is ok. I don't plan or want to have further library dependencies, so I would include it directly into the code. The winuae source files HerzAusGold mentioned might be a good start for that... :-)
Post Reply