diff options
Diffstat (limited to 'modules/remote-filesystem/c++')
-rw-r--r-- | modules/remote-filesystem/c++/transfer.hpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/remote-filesystem/c++/transfer.hpp b/modules/remote-filesystem/c++/transfer.hpp index 22a35a8..26a2b7b 100644 --- a/modules/remote-filesystem/c++/transfer.hpp +++ b/modules/remote-filesystem/c++/transfer.hpp @@ -43,7 +43,7 @@ public: return generate_invalid_id_error(); } - std::basic_ofstream<uint8_t> s{addr_.get_path(), s.binary | s.out | s.trunc}; + std::fstream s{addr_.get_path(), s.binary | s.out | s.trunc}; if(!s.is_open()){ return make_error<err::not_found>("Couldn't open file"); } @@ -51,7 +51,7 @@ public: auto& buff = dat.get_buffer(); buffer_view buff_v{buff}; while(buff_v.read_segment_length() > 0u){ - s.write(&buff_v.read(), buff_v.read_segment_length()); + s.write(reinterpret_cast<char*>(&buff_v.read()), buff_v.read_segment_length()); buff_v.read_advance(buff_v.read_segment_length()); } s.flush(); @@ -86,12 +86,12 @@ public: data<Schema, Encoding> dat{heap<array_buffer>(1u)}; - std::basic_fstream<uint8_t> s{addr_.get_path(), s.binary | s.in}; + std::fstream s{addr_.get_path(), s.binary | s.in}; if(!s.is_open()){ return make_error<err::not_found>("Couldn't open file"); } uint8_t ele{}; - while(s.readsome(&ele, 1u) > 0u){ + while(s.readsome(reinterpret_cast<char*>(&ele), 1u) > 0u){ auto err = dat.get_buffer().push(ele,1u); if(err.failed()){ |