Browse Source

fix: mindrecord seekg failed when shift raw page

tags/v0.5.0-beta
jonyguo 5 years ago
parent
commit
2aaf3a37d4
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      mindspore/ccsrc/mindrecord/io/shard_writer.cc

+ 1
- 1
mindspore/ccsrc/mindrecord/io/shard_writer.cc View File

@@ -90,7 +90,7 @@ MSRStatus ShardWriter::OpenDataFiles(bool append) {
fs->close(); fs->close();


// open the mindrecord file to write // open the mindrecord file to write
fs->open(common::SafeCStr(file), std::ios::out | std::ios::binary);
fs->open(common::SafeCStr(file), std::ios::out | std::ios::in | std::ios::binary | std::ios::trunc);
if (!fs->good()) { if (!fs->good()) {
MS_LOG(ERROR) << "MindRecord file could not opened."; MS_LOG(ERROR) << "MindRecord file could not opened.";
return FAILED; return FAILED;


Loading…
Cancel
Save