X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0805d73f8032718b02cce7be446bf87bad17905f..3eaab01ff3aaf3b8addf247073237c5891f485d4:/src/surf/FileImpl.hpp diff --git a/src/surf/FileImpl.hpp b/src/surf/FileImpl.hpp index e8ae85bb1d..b50fa8f262 100644 --- a/src/surf/FileImpl.hpp +++ b/src/surf/FileImpl.hpp @@ -26,6 +26,23 @@ public: void setPosition(sg_size_t size) { current_position_ = size; } void incrPosition(sg_size_t incr) { current_position_ += incr; } sg_size_t tell() { return current_position_; } + int seek(sg_offset_t offset, int origin) + { + switch (origin) { + case SEEK_SET: + current_position_ = offset; + return 0; + case SEEK_CUR: + current_position_ += offset; + return 0; + case SEEK_END: + current_position_ = size_ + offset; + return 0; + default: + return -1; + } + } + private: std::string path_; std::string mount_point_;