Change-Id: I46251f11892788bde41fdc57ba88bc331fee3cd1
Signed-off-by: Seok Hong <seok85.hong@samsung.com>
#define __RUNTIME_FILESYSTEM_H__
#include <dirent.h>
+#include <sys/types.h>
#include <string>
void open(int flags);
void read(void *buffer, const size_t size) const;
void write(const void *buffer, const size_t size) const;
+ void lseek(off_t offset, int whence) const;
void close();
File copyTo(const std::string& pathname);
void remove(bool recursive = false);
}
}
+void File::lseek(off_t offset, int whence) const
+{
+ if (::lseek(descriptor, offset, whence) == -1) {
+ throw runtime::Exception(runtime::GetSystemErrorMessage());
+ }
+}
+
File File::copyTo(const std::string& destDir)
{
const std::string& filename = getPath();
tmp.create(755);
tmp.lock();
tmp.write(testbuf, ::strlen(testbuf));
+ tmp.lseek(10, SEEK_SET);
tmp.unlock();
tmp.close();
} catch (runtime::Exception& e) {