bugGuile - Bugs: bug #27640, scm_copy_file must open files with...


bug #27640: scm_copy_file must open files with O_BINARY under mingw

Submitter:  Scott McPeak <smcpeak>
Submitted:  Fri 09 Oct 2009 05:08:11 AM UTC
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup

Fri 09 Oct 2009 05:08:11 AM UTC, original submission:  

The scm_copy_file function must open the input and output files with O_BINARY under mingw in order to satisfy the (implicit) specification that the output file's contents equal the input file's contents once the copy operation completes.

Without O_BINARY, the files are opened in text mode.  This causes LF to CRLF translation for unix text files, but more importantly, truncates binary files as soon as a DOS EOF (ctrl-D) character is encountered.

Suggested patch attached.

Scott McPeak <smcpeak>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #18835:  copy-file-binary-mode.diff added by smcpeak (1KiB - text/x-patch)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by smcpeak (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-10-09 smcpeak Attached File- Added copy-file-binary-mode.diff, #18835

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code