Bug 52561 - FILEOPEN: FILEOPEN on empty files results in a blank master document being written to the empty file.
Summary: FILEOPEN: FILEOPEN on empty files results in a blank master document being wr...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
3.5.5.3 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-26 20:14 UTC by Greg M
Modified: 2013-12-12 15:18 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
This is the file after opening. (1.50 KB, text/csv)
2012-07-26 20:14 UTC, Greg M
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Greg M 2012-07-26 20:14:46 UTC
Created attachment 64753 [details]
This is the file after opening.

Problem description: 
Much like https://bugs.freedesktop.org/show_bug.cgi?id=46699 (this may be a regression of that bug... opening an empty (0 byte) file causes a master file to be silently written to the file location as soon as "CSV Filter" is invoked.  Some formats (like PDF) give an error dialog (General Error), then exit more properly.

Touch (or Copy NUL: >filename.csv) to create an empty file
Steps to reproduce:
1. Touch (or Copy NUL: >filename.csv) to create an empty file
2. Double-click to open the file in LibreOffice
3. Select CSV filter
4. File on disk will likely be an empty master document.

Current behavior:
Master Document is written to disk, even if the file is not saved. 

**While normally I'd say this is heinously dangerous, If this only happens with empty files, it's only confusing.**
Expected behavior:

LibreOffice should _warn_ if you're opening an empty file and _ask_ if you want to create a new file with that filename/path.

The file length should probably be checked _before_ we get to that filter dialog.  If the file does not exist, or does exist, but has no length (or maybe we don't have access to read the file!) this should probably be explained better.

Platform (if different from the browser): 
Windows 7 32 Bit
LibreOffice 3.5.5.3 
Build ID: 7122e39-92ed229-498d286-15e43b4-d70da21Browser:
Comment 1 Greg M 2012-07-28 01:26:56 UTC
This is fixed on Version 3.6.0.2 (Build ID: 815c576) of the Mac.
Comment 2 retired 2013-06-24 07:12:33 UTC
Setting to WORKSFORME as of Comment 1.

Greg M: Should this have returned with LO 4 in the meantime, please re-open this bug.
Comment 3 Greg M 2013-06-24 17:34:40 UTC
Still fixed as of LO 4.0.4.2