QB64-Phoenix-Edition / QB64pe

The QB64 Phoenix Edition Repository
https://qb64phoenix.com
Other
132 stars 26 forks source link

Editor gives confusing/cryptic message when save is a sharing violation or to a read-only file #469

Open electric-socket opened 8 months ago

electric-socket commented 8 months ago

Describe the bug When saving a file which is simultaneously open in another application (and/or read only), a cryptic error message is generated, even though it should be able to say why.

To Reproduce Steps to reproduce the behavior:

  1. open a program source file in some other application that keeps the file open or write locked, or mark the file read only
  2. open the same file with QB64pe. This will work because open does not need write access to the file
  3. [Optional] edit the file
  4. Attempt to save the file. If another program has it open, this will fail with error no. 70 as it is a sharing violation.
  5. Error returned is Error 23769-12565 Cannot save file
  6. However, when you open a file that is read-only, on save, the error is
  7. Error 23769-12515 Cannot save file

Expected behavior For error 12565 the message should be something like "File open in another program" or "Sharing violation" then "cannot save file" For error 12515 the message should be something like "File is read on;ly" then "cannot save file"

Since the editor is able to differentiate between the two types of save failures, it should explain them more succinctly

Desktop (please complete the following information):


Paul Robinson paul@paul-robinson.us - User TDarcos on QB64pe Forum "The lessons of history teach us - if they teach us anything - that no one learns the lessons that history teaches us."