From b33f306311fa480be6cb5bd6c83d6ed4c318d484 Mon Sep 17 00:00:00 2001 From: dkf Date: Fri, 8 Dec 2000 11:12:42 +0000 Subject: Applied patch #102680 after review and approval by several TCT members --- ChangeLog | 6 ++++++ doc/open.n | 17 +++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index dbd1e01..62e2e8c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2000-12-08 Donal K. Fellows + + * doc/open.n: Added xref to fconfigure and advice on the opening + of binary files. Should help prevent a recurrence of bugs like + #124558 + 2000-12-07 jeff hobbs * generic/tcl.h: added note about need to updated diff --git a/doc/open.n b/doc/open.n index 260573f..d5f73d7 100644 --- a/doc/open.n +++ b/doc/open.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: open.n,v 1.10 2000/09/07 14:27:50 poenitz Exp $ +'\" RCS: @(#) $Id: open.n,v 1.11 2000/12/08 11:12:42 dkf Exp $ '\" .so man.macros .TH open n 7.6 Tcl "Tcl Built-In Commands" @@ -108,6 +108,18 @@ If a new file is created as part of opening it, \fIpermissions\fR (an integer) is used to set the permissions for the new file in conjunction with the process's file mode creation mask. \fIPermissions\fR defaults to 0666. +.PP +'\" Not versioned as advice applies to all recent versions of Tcl. +'\" Prior to that, Tcl didn't really support binary files anyway... +.VS +Note that if you are going to be reading or writing binary data from +the channel created by this command, you should use the +\fBfconfigure\fR command to change the \fB-translation\fI option of +the channel to \fBbinary\fR before transferring any binary data. This +is in contrast to the ``b'' character passed as part of the equivalent +of the \fIaccess\fR parameter to some versions of the C library +\fIfopen()\fR function. +.VE .SH "COMMAND PIPELINES" .PP If the first character of \fIfileName\fR is ``|'' then the @@ -253,7 +265,8 @@ information not specific to command pipelines about executing applications on the various platforms .SH "SEE ALSO" -file(n), close(n), filename(n), gets(n), read(n), puts(n), exec(n), fopen(1) +file(n), close(n), filename(n), fconfigure(n), gets(n), read(n), +puts(n), exec(n), fopen(1) .SH KEYWORDS access mode, append, create, file, non-blocking, open, permissions, -- cgit v0.12