/** this was posted as a fast function for moving files... lolwat!? **/ /* * Fast function for moving files. * — Unlimiter */ // This function has been tested with 'https://norvig.com/big.txt' which has the size of 6488666 bytes, and the execution time was very close to null. // At that point, it is very comparable to the 'mv' command on Linux. void move(char* src_path, char* dest_path) { #include FILE* src = fopen(src_path, "rb"); FILE* dest = fopen(dest_path, "wb"); fseek(src, 0, SEEK_END); unsigned long long src_size = ftell(src); rewind(src); char* buf; fread(buf, 1, src_size, src); fwrite(buf, 1, src_size, dest); remove(src_path); } // Uncomment the main function for testing through the command line. /* int main(int argc, char** argv) { if (argc > 2) { move(argv[1], argv[2]); } } */