- file->dump();
-
- XBT_INFO("Try to read %llu from '%s'", file->size(), filename);
- sg_size_t read = file->read(file->size());
- XBT_INFO("Have read %llu from '%s'. Offset is now at: %llu", read, filename, file->tell());
- XBT_INFO("Seek back to the begining of the stream...");
- file->seek(0, SEEK_SET);
- XBT_INFO("Offset is now at: %llu", file->tell());
-
- delete file;
-
- if (argc > 5) {
- file = new simgrid::s4u::File(argv[2], nullptr);
- filename = file->getPath();
- XBT_INFO("Opened file '%s'", filename);
- XBT_INFO("Try to write %llu MiB to '%s'", file->size() / 1024, filename);
- sg_size_t write = file->write(file->size() * 1024);
- XBT_INFO("Have written %llu bytes to '%s'.", write, filename);
-
- if (std::stoi(argv[5]) != 0) {
- XBT_INFO("Move '%s' (of size %llu) from '%s' to '%s'", filename, file->size(),
- simgrid::s4u::Host::current()->getCname(), argv[3]);
- file->remoteMove(simgrid::s4u::Host::by_name(argv[3]), argv[4]);
+ file.dump();
+ XBT_INFO("Try to write %llu MiB to '%s'", file.size() / 1024, filename);
+ sg_size_t write = file.write(file.size() * 1024);
+ XBT_INFO("Have written %llu MiB to '%s'.", write / (1024 * 1024), filename);
+
+ if (argc > 4) {
+ if (std::stoi(argv[4]) != 0) {
+ XBT_INFO("Move '%s' (of size %llu) from '%s' to '%s'", filename, file.size(),
+ simgrid::s4u::Host::current()->get_cname(), argv[2]);
+ file.remote_move(simgrid::s4u::Host::by_name(argv[2]), argv[3]);