Problem with HTLoadToFile when using graphic-files

Hello !

I'm using the w3clib under WinNT 4.0 , and some of the examples of the w3clib on http://www.w3.org/Library/Examples/ using the functions HTLoadToChunk and HTLoadToFile.
Downloading a URL ( using the access scheme http: ) works fine. When using a local file ( with the access scheme file: ), it works fine for a html-file but not for a graphic-file ! 
My question: Can I use the w3clib (with the access scheme file: ) for local graphic files ?
	like (in a test-version):	HTLoadToFile-Program  file:graphicfile.gif   saved_filename.gif

I debugged the code and found the following:
Under Windows the HTProfile_newPreemptiveClient-function uses HTTransportInit, which calls in the case of NO_UNIX_IO the function HTTransport_add("local", HT_TP_SINGLE, HTANSIReader_new, HTANSIWriter_new); .
Thus, reading the local file uses the HTANSIReader_read-function of HTANSI.c which will not get good results for graphic-files! 
(For graphic-files it should be used the HTReader_read-function of HTReader.c ).

Under UNIX it works fine due to the compiler flag #ifndef NO_UNIX_IO and the use of 
	HTTransport_add("local", HT_TP_SINGLE, HTReader_new, HTWriter_new);
Thus, under UNIX I can use local html-files as well as graphic-files !

If somebody has (or had) a similar problem and knows an answer (or solution) to the problem, please give me answer !
I will continue finding some more information in the web-pages of the w3clib to my question.

Thanks,
Thomas

EMail: thomas.maier@infonova.at

Received on Friday, 27 March 1998 06:41:05 UTC