storage->setUserdata(new std::string("Some user data"));
std::string* storage_data = static_cast<std::string*>(storage->getUserdata());
XBT_INFO(" Set and get data: '%s'", storage_data->c_str());
+
delete storage_data;
+
+ // Reopen the file and then unlink it
+ file = new simgrid::s4u::File("/home/tmp/simgrid.readme", nullptr);
+ XBT_INFO("Unlink file: '%s'", file->getPath());
+ file->unlink();
+
+ show_info(mounts);
}
};
{
simgrid::s4u::Engine e(&argc, argv);
sg_storage_file_system_init();
- const char* platffile = "../../platforms/storage/storage.xml";
- if (argc > 1)
- platffile = argv[1];
- e.loadPlatform(platffile);
+ e.loadPlatform(argv[1]);
simgrid::s4u::Actor::createActor("host", simgrid::s4u::Host::by_name("denise"), MyHost());
e.run();
> [denise:host:(1) 0.006000] [s4u_test/INFO] Get/set data for storage element: Disk4
> [denise:host:(1) 0.006000] [s4u_test/INFO] Uninitialized storage data: '(null)'
> [denise:host:(1) 0.006000] [s4u_test/INFO] Set and get data: 'Some user data'
+> [denise:host:(1) 0.006000] [s4u_test/INFO] Unlink file: '/home/tmp/simgrid.readme'
+> [denise:host:(1) 0.006000] [s4u_test/INFO] Storage info on denise:
+> [denise:host:(1) 0.006000] [s4u_test/INFO] Disk2 (c:) Used: 2391537133; Free: 534479374867; Total: 536870912000.
+> [denise:host:(1) 0.006000] [s4u_test/INFO] Disk4 (/home) Used: 13221994; Free: 536857690006; Total: 536870912000.