gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Fetching a remote file?

#122197 - testforechozero - Sat Mar 17, 2007 8:40 pm

Hi,

I'm sort of new to coding on the DS and using C++ in general. I've been successful in printing text and taking stylus movements, thats about it.


Anyway, now i'm experimenting with fetching stuff from servers. Not anything on the webbrowser scale, but enough so I can perhaps fetch a daily message/quote from a text file on my server?


My problem is: Right now, I'm storing the data like so:
char buffer[2048];

This is not holding the contents of the file. So my question is, what is the best datatype to hold fetched data in?

BTW, I'm using PAlib, so when I use GetHTTP, the buffer needs to be a 'char'. I'm wondering if theres a way to receive part of the file at once, store it in a string/something else, then fetch the rest of the file?

#122471 - silent_code - Mon Mar 19, 2007 3:51 pm

i'd advise you better get to know the hardware a bit better (as well as the language), if you're new to it, before trying to do funky wifi stuff. ;^) also, taking a look at the sources of programs like less/more could help, as these should be able to display remote files. but again, if that helps depends on your understanding of c/c++ and data structures in general.

happy coding!

#122525 - Lynx - Mon Mar 19, 2007 11:49 pm

I'd also suggest you head over to the PAlib forums and post your question, as you have a better chance of getting a PAlib based answer there.
_________________
NDS Homebrew Roms & Reviews