SimGrid
3.14.159
Versatile Simulation of Distributed Systems
|
A simulated file.
Used to simulate the time it takes to access to a file, but does not really store any information.
They are located on simgrid::s4u::Storage that are accessed from a given simgrid::s4u::Host through mountpoints. For now, you cannot change the mountpoints programatically, and must declare them from your platform file.
#include <file.hpp>
Public Member Functions | |
File (const char *fullpath, void *userdata) | |
~File () | |
const char * | path () |
Retrieves the path to the file. More... | |
sg_size_t | read (sg_size_t size) |
Simulates a read action. More... | |
sg_size_t | write (sg_size_t size) |
Simulates a write action. More... | |
void | setUserdata (void *data) |
Allows to store user data on that host. More... | |
void * | userdata () |
Retrieves the previously stored data. More... | |
sg_size_t | size () |
Retrieve the datasize. More... | |
void | seek (sg_size_t pos) |
Sets the file head to the given position. More... | |
sg_size_t | tell () |
Retrieves the current file position. More... | |
void | move (const char *fullpath) |
Rename a file. More... | |
void | unlink () |
Remove a file from disk. More... | |
simgrid::s4u::File::File | ( | const char * | fullpath, |
void * | userdata | ||
) |
simgrid::s4u::File::~File | ( | ) |
|
inline |
Retrieves the path to the file.
Simulates a read action.
Returns the size of data actually read
FIXME: reading from a remotely mounted disk is not implemented yet. Any storage is considered as local, and no network communication ever occur.
Simulates a write action.
Returns the size of data actually written.
FIXME: reading from a remotely mounted disk is not implemented yet. Any storage is considered as local, and no network communication ever occur.
|
inline |
Retrieves the previously stored data.
sg_size_t simgrid::s4u::File::size | ( | ) |
Retrieve the datasize.
sg_size_t simgrid::s4u::File::tell | ( | ) |
Retrieves the current file position.
void simgrid::s4u::File::move | ( | const char * | fullpath | ) |
Rename a file.
WARNING: It is forbidden to move the file to another mount point
void simgrid::s4u::File::unlink | ( | ) |
Remove a file from disk.