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



On Mon, 07 Feb 2005 13:13:38 +0100, stian nixia no said:
> > 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.

Another good idea would be to add code to sanity-check the source and
destination to make sure they make sense (i.e. for Unix-style systems, it's a
bad idea to allow the source to be /dev/zero, and for Windows-style boxes,
things like CON: might not be good... ;)

Attachment: pgpLDPRk2WAfp.pgp
Description: PGP signature



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