[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #63803] Saving causes OOM, crash, and loss of
From: |
Markus Mützel |
Subject: |
[Octave-bug-tracker] [bug #63803] Saving causes OOM, crash, and loss of already saved data |
Date: |
Sat, 6 May 2023 11:02:49 -0400 (EDT) |
Follow-up Comment #38, bug #63803 (project octave):
I started up my Ubuntu machine and ran the following tests for completeness:
>> mkdir file1
>> mkdir file2
>> rename file1 file2
>> mkdir file1
>> fid = fopen('file1/a', 'w'); fclose(fid);
>> fid = fopen('file2/b', 'w'); fclose(fid);
>> rename file1 file2
error: rename: operation failed: Directory not empty
Tbh, the behavior of `std::rename` on Windows seems to be a lot more
consistent than its behavior on Linux.
On Windows, the behavior is: Fail if the target already exists. Point.
On Linux, the behavior seems to be:
If the source is a regular file and the target is a regular file, overwrite
the target.
If the source is a regular file and the target is a folder, fail.
If the source is a folder and the target is a regular file, fail.
If the source is a folder and the target is an empty folder, overwrite the
target.
If the source is a folder and the target is a non-empty folder, fail.
While there might be a motivation to this mess, it still looks like a mess to
me...
Imho, a reasonable compromise to implement a common behavior across platforms
for Octave might be:
If the source is a regular file and the target is a regular file, overwrite
the target.
In all other cases where a target already exists, fail.
It would cover the issue here while keeping the logic still pretty straight.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?63803>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #63803] Saving causes OOM, crash, and loss of already saved data, Markus Mützel, 2023/05/04
- [Octave-bug-tracker] [bug #63803] Saving causes OOM, crash, and loss of already saved data, Markus Mützel, 2023/05/05
- [Octave-bug-tracker] [bug #63803] Saving causes OOM, crash, and loss of already saved data, Dmitri A. Sergatskov, 2023/05/05
- [Octave-bug-tracker] [bug #63803] Saving causes OOM, crash, and loss of already saved data, Dmitri A. Sergatskov, 2023/05/05
- [Octave-bug-tracker] [bug #63803] Saving causes OOM, crash, and loss of already saved data, Markus Mützel, 2023/05/06
- [Octave-bug-tracker] [bug #63803] Saving causes OOM, crash, and loss of already saved data, Dmitri A. Sergatskov, 2023/05/06
- [Octave-bug-tracker] [bug #63803] Saving causes OOM, crash, and loss of already saved data,
Markus Mützel <=
- [Octave-bug-tracker] [bug #63803] Saving causes OOM, crash, and loss of already saved data, Markus Mützel, 2023/05/06
- [Octave-bug-tracker] [bug #63803] Saving causes OOM, crash, and loss of already saved data, Markus Mützel, 2023/05/09
- [Octave-bug-tracker] [bug #63803] Saving causes OOM, crash, and loss of already saved data, Markus Mützel, 2023/05/21