Bug 14414 - download.file() leaves destination file open on error
download.file() leaves destination file open on error
Status: CLOSED FIXED
Product: R
Classification: Unclassified
Component: I/O
R 2.12.0
ix86 (32-bit) Windows 32-bit
: P5 normal
Assigned To: Brian
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-10-19 04:01 UTC by Duncan Murdoch
Modified: 2010-12-26 03:05 UTC (History)
0 users

See Also:


Attachments
test web (deleted)
2010-12-26 02:43 UTC, Brian
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Duncan Murdoch 2010-10-19 04:01:49 UTC
Running 

download.file("http://example.com/junk.txt", "output.txt")

will generate errors after opening the "output.txt" file, and leaves the file handle open.  In Windows this results in a new file that can't be deleted until R closes.
Comment 1 Brian Ripley 2010-10-19 22:21:43 UTC
I believe I have fixed this, but I cannot actually reproduce it.  Can 
you try r53369?

BTW to Simon: the trunk is 2.13.0-to-be, and has been for a month.

On Mon, 18 Oct 2010, r-bugs@r-project.org wrote:

> https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14414
>
>           Summary: download.file() leaves destination file open on error
>           Product: R
>           Version: R-devel (trunk, R 2.12.0-to-be)
>          Platform: PC/x86
>        OS/Version: Windows
>            Status: NEW
>          Severity: normal
>          Priority: P5
>         Component: I/O
>        AssignedTo: R-core@R-project.org
>        ReportedBy: murdoch@stats.uwo.ca
>   Estimated Hours: 0.0
>
>
> Running
>
> download.file("http://example.com/junk.txt", "output.txt")
>
> will generate errors after opening the "output.txt" file, and leaves the file
> handle open.  In Windows this results in a new file that can't be deleted until
> R closes.
>
> -- 
> Configure bugmail: https://bugs.r-project.org/bugzilla3/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are the assignee for the bug.
>
> _______________________________________________
> R-core list: https://stat.ethz.ch/mailman/listinfo/r-core
>


-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


Comment 2 Duncan Murdoch 2010-10-19 23:09:10 UTC
  On 19/10/2010 1:21 PM, Prof Brian Ripley wrote:
> I believe I have fixed this, but I cannot actually reproduce it.  Can
> you try r53369?


Yes, looks fixed here.  Thanks.

Duncan Murdoch

> BTW to Simon: the trunk is 2.13.0-to-be, and has been for a month.
>
> On Mon, 18 Oct 2010, r-bugs@r-project.org wrote:
>
> >  https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14414
> >
> >            Summary: download.file() leaves destination file open on error
> >            Product: R
> >            Version: R-devel (trunk, R 2.12.0-to-be)
> >           Platform: PC/x86
> >         OS/Version: Windows
> >             Status: NEW
> >           Severity: normal
> >           Priority: P5
> >          Component: I/O
> >         AssignedTo: R-core@R-project.org
> >         ReportedBy: murdoch@stats.uwo.ca
> >    Estimated Hours: 0.0
> >
> >
> >  Running
> >
> >  download.file("http://example.com/junk.txt", "output.txt")
> >
> >  will generate errors after opening the "output.txt" file, and leaves the file
> >  handle open.  In Windows this results in a new file that can't be deleted until
> >  R closes.
> >
> >  -- 
> >  Configure bugmail: https://bugs.r-project.org/bugzilla3/userprefs.cgi?tab=email
> >  ------- You are receiving this mail because: -------
> >  You are the assignee for the bug.
> >
> >  _______________________________________________
> >  R-core list: https://stat.ethz.ch/mailman/listinfo/r-core
> >
>



Comment 3 Brian Ripley 2010-10-20 04:45:38 UTC
Fixed in 2.12.0 patched
Comment 4 Brian 2010-12-26 02:43:15 UTC
Created attachment 1162 [details]
test web
Comment 5 Duncan Murdoch 2010-12-26 03:05:19 UTC
The content of attachment 1162 [details] has been deleted by
    Duncan Murdoch <murdoch@stats.uwo.ca>
without providing any reason.

The token used to delete this attachment was generated at 2010-12-25 21:05:14 EST.