refactor
This commit is contained in:
@ -431,26 +431,27 @@ auto open_file::native_operation(
|
|||||||
: new_file_size % chunk_size_);
|
: new_file_size % chunk_size_);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (original_file_size != new_file_size) {
|
if (original_file_size == new_file_size) {
|
||||||
set_modified();
|
return res;
|
||||||
|
}
|
||||||
|
set_modified();
|
||||||
|
|
||||||
fsi_.size = new_file_size;
|
fsi_.size = new_file_size;
|
||||||
auto now = std::to_string(utils::time::get_time_now());
|
auto now = std::to_string(utils::time::get_time_now());
|
||||||
res = provider_.set_item_meta(
|
res = provider_.set_item_meta(fsi_.api_path,
|
||||||
fsi_.api_path, {
|
{
|
||||||
{META_CHANGED, now},
|
{META_CHANGED, now},
|
||||||
{META_MODIFIED, now},
|
{META_MODIFIED, now},
|
||||||
{META_SIZE, std::to_string(new_file_size)},
|
{META_SIZE, std::to_string(new_file_size)},
|
||||||
{META_WRITTEN, now},
|
{META_WRITTEN, now},
|
||||||
});
|
});
|
||||||
if (res != api_error::success) {
|
if (res == api_error::success) {
|
||||||
utils::error::raise_api_path_error(function_name, get_api_path(), res,
|
return res;
|
||||||
"failed to set file meta");
|
|
||||||
return set_api_error(res);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
utils::error::raise_api_path_error(function_name, get_api_path(), res,
|
||||||
|
"failed to set file meta");
|
||||||
|
return set_api_error(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto open_file::read(std::size_t read_size, std::uint64_t read_offset,
|
auto open_file::read(std::size_t read_size, std::uint64_t read_offset,
|
||||||
|
Reference in New Issue
Block a user