Bug 17243 - write.table doesn't check fpwrite status
Summary: write.table doesn't check fpwrite status
Status: CLOSED FIXED
Alias: None
Product: R
Classification: Unclassified
Component: I/O (show other bugs)
Version: R-devel (trunk)
Hardware: All All
: P5 enhancement
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2017-03-22 14:40 UTC by Jean-Sébastien Bevilacqua
Modified: 2017-07-14 20:45 UTC (History)
1 user (show)

See Also:


Attachments
patch0 (2.74 KB, patch)
2017-03-22 14:40 UTC, Jean-Sébastien Bevilacqua
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Sébastien Bevilacqua 2017-03-22 14:40:53 UTC
Created attachment 2240 [details]
patch0

When you use the function write.table, if the disk is full for example, the function doesn't return an error and the file is written but truncated.

It can be a source of mistakes because you can then copy the output file and think everything is ok.

How to reproduce
-------------------------

>> write.csv(1:10000000, 'path')

You must have a path with a small amount of disk available (on linux: http://souptonuts.sourceforge.net/quota_tutorial.html)

I have added a patch but it may need refactoring because there is a lot of copy/paste.

Thanks,
Jean-Sébastien Bevilacqua
Comment 1 Jean-Sébastien Bevilacqua 2017-06-26 07:49:05 UTC
Any news about my contribution ?
Thanks in advance for your time.

Jean-Sebastien Bevilacqua
Comment 2 Duncan Murdoch 2017-07-04 23:26:54 UTC
Fixed in R-devel as of rev 72891.  Will port to R-patched after some testing.
Comment 3 Jean-Sébastien Bevilacqua 2017-07-05 08:22:44 UTC
Thanks a lot Duncan!
Comment 4 Duncan Murdoch 2017-07-14 20:45:01 UTC
Now ported to R-patched