Re: Can someone tell me how I can copy a binary file



> Can someone tell me how I can copy a binary file. Is glib not good for
> this? And how should the code be then. A code example would be really
> welcome! thx

Increase your buffer to be 4096 bytes atleast even much bigger like a
megabyte to lessen the number of iterations you need and number of
syscalls done.

You will need to loop reading/writing until you aren't able to read any
more data. If you are in Gtk it can be a good ide to call g_main_iterate
inside the loop, so the program doesn't freeze for the user.




Stian Skjelstad aka mw|



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]