diff --git a/bc/File.hpp b/bc/File.hpp index 331bd5b..096c9f9 100644 --- a/bc/File.hpp +++ b/bc/File.hpp @@ -11,6 +11,7 @@ #include "bc/file/CreateDirectory.hpp" #include "bc/file/Delete.hpp" #include "bc/file/Exists.hpp" +#include "bc/file/Flush.hpp" #include "bc/file/GetFileInfo.hpp" #include "bc/file/GetPos.hpp" #include "bc/file/GetWorkingDirectory.hpp" diff --git a/bc/file/Flush.cpp b/bc/file/Flush.cpp new file mode 100644 index 0000000..85b34cc --- /dev/null +++ b/bc/file/Flush.cpp @@ -0,0 +1,18 @@ +#include "bc/file/Flush.cpp" +#include "bc/system/file/Stacked.hpp" + +namespace Blizzard { +namespace File { + +// flush +bool Flush(StreamRecord* file) { + System_File::Stacked::FileParms parms; + parms.op = offsetof(Filesystem, flush); + parms.file = file; + + auto fs = System_File::Stacked::s_manager; + return fs ? fs->flush(fs, &parms) : false; +} + +} // namespace File +} // namespace Blizzard \ No newline at end of file diff --git a/bc/file/Flush.hpp b/bc/file/Flush.hpp new file mode 100644 index 0000000..38c86cc --- /dev/null +++ b/bc/file/Flush.hpp @@ -0,0 +1,15 @@ +#ifndef BC_FILE_FLUSH_HPP +#define BC_FILE_FLUSH_HPP + +#include "bc/file/Types.hpp" + +namespace Blizzard { +namespace File { + +// flush +bool Flush(StreamRecord* file); + +} // namespace File +} // namespace Blizzard + +#endif