// Copyright {Jagger Software Limited} 2003 #ifndef IO_FILE_SIZE_INCLUDED #define IO_FILE_SIZE_INCLUDED #include #include namespace io { size_t file_size(FILE * stream); } #endif //------------------------------------------------- // Example of use #if 0 #include "io/file_size.hpp" #include "io/FILE_iterator.hpp" #include "ownership/array_deleter.hpp" #include "ownership/scoped.hpp" #include "ownership/fcloser.hpp" #include #include using namespace ::ownership; using namespace ::std; int main(int argc, char * argv[]) { scoped stream(fopen(argv[1], "rb")); const size_t file_size = file_size(stream.get()); scoped source(new char[file_size]); copy(FILE_iterator(stream.get()), end, source.get()); //... return 0; } #endif