I’m working in a system that use PHYSFS to search files. The problem is that now I need to deploy files (that is, to copy a phisical copy of the file into a directory). My first solution is open file, load into memory and then write to another file, but I think that it would exists a faster method to deploy files.
Any ideas?
In general, yes, going through each file, reading it and then writing it is what you want. Note that you probably shouldn’t load the entire file into memory at once, though – instead use PHYSFS_read to read a fixed buffer (64kb or so should be good) from the source file, write it to the destination file, and repeat.