nus-cs2113-AY2324S2 / pe-dev-response

0 stars 0 forks source link

Error when data file is open in another program #2177

Open nus-se-script opened 6 months ago

nus-se-script commented 6 months ago

image.png

I had my CSV file open in microsoft excel when running this series of commands.

Maybe prevent editing when the data file is locked can prevent this error.


[original: nus-cs2113-AY2324S2/pe-interim#1942] [original labels: severity.Low type.FunctionalityBug]

NgYaoDong commented 6 months ago

Team's Response

Hi there, thank you for your report.

I have tried to replicate the bug as per your description, and indeed I faced the same issue that you encountered. This is mainly due to Excel locking the file while it is being opened within Excel, and our StockPal app also reading and writing from the same file at the same time. I also appreciate the fact that you suggested that we should prevent editing when the data file is locked to prevent the error. However, after some googling and research, it showed that this might not be possible as CSV on its own is a text file, and thus the prevention of editing the file might only be possible if done at the system/OS level. I have also attached some screenshots of the results of my search below, and please do correct me if I'm wrong.

The links to these pages are respectively: 1) Reddit post on making a CSV uneditable 2) Chat history with Gemini

image.png

image.png

In addition, I have also found a solution to this, which is to close the Excel file before running exit in the StockPal app. In this way, the data that you entered within that StockPal session will still be saved properly into the CSV file, even though it might most likely overwrite the changes you did in Excel. We do still appreciate such reports, as it shows that there would definitely be ways that our app can be improved. If you have any specific way that we can prevent editing while the data file is being opened in Excel, please do advise us. Thank you very much for the report!

Best Regards, StockPal Team

Duplicate status (if any):

--