mirror of
https://github.com/akuker/RASCSI.git
synced 2025-01-17 19:30:44 +00:00
Prevent copying of files in use (#951)
This commit is contained in:
parent
6e35577368
commit
f84a13b3e2
@ -249,6 +249,12 @@ bool RascsiImage::CopyImage(const CommandContext& context, const PbCommand& comm
|
||||
return context.ReturnStatus(false, "Can't read source image file '" + from + "'");
|
||||
}
|
||||
|
||||
const auto [id, lun] = StorageDevice::GetIdsForReservedFile(from);
|
||||
if (id != -1 || lun != -1) {
|
||||
return context.ReturnStatus(false, "Can't copy image file '" + from +
|
||||
"', it is currently being used by device ID " + to_string(id) + ", LUN " + to_string(lun));
|
||||
}
|
||||
|
||||
if (!CreateImageFolder(context, to)) {
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user