summaryrefslogtreecommitdiffstats
path: root/generic/tclIOCmd.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2005-04-27 18:48:21 (GMT)
committerdgp <dgp@users.sourceforge.net>2005-04-27 18:48:21 (GMT)
commit7842c9275791d34656b40014d43e8177a94010ad (patch)
treeaa7be44c0131f5a0a25dbcef7634100323b8a039 /generic/tclIOCmd.c
parentec3f17501d816894810d4d4ea984e4f60e6217fe (diff)
downloadtcl-7842c9275791d34656b40014d43e8177a94010ad.zip
tcl-7842c9275791d34656b40014d43e8177a94010ad.tar.gz
tcl-7842c9275791d34656b40014d43e8177a94010ad.tar.bz2
TIP#183 IMPLEMENTATION [Patch 577093]
* generic/tclIOUtil.c (TclGetOpenModeEx): New routine. * generic/tclInt.h: * generic/tclIO.c (Tcl_OpenObjCmd): Support for "b" and * doc/open.n: "BINARY" in "access" argument to [open]. * tests/ioCmd.test:
Diffstat (limited to 'generic/tclIOCmd.c')
-rw-r--r--generic/tclIOCmd.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c
index 732b162..fc14619 100644
--- a/generic/tclIOCmd.c
+++ b/generic/tclIOCmd.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIOCmd.c,v 1.22 2004/10/07 00:24:49 dgp Exp $
+ * RCS: @(#) $Id: tclIOCmd.c,v 1.23 2005/04/27 18:48:25 dgp Exp $
*/
#include "tclInt.h"
@@ -960,14 +960,14 @@ Tcl_OpenObjCmd(notUsed, interp, objc, objv)
if (!pipeline) {
chan = Tcl_FSOpenFileChannel(interp, objv[1], modeString, prot);
} else {
- int mode, seekFlag, cmdObjc;
+ int mode, seekFlag, cmdObjc, binary;
CONST char **cmdArgv;
if (Tcl_SplitList(interp, what+1, &cmdObjc, &cmdArgv) != TCL_OK) {
return TCL_ERROR;
}
- mode = TclGetOpenMode(interp, modeString, &seekFlag);
+ mode = TclGetOpenModeEx(interp, modeString, &seekFlag, &binary);
if (mode == -1) {
chan = NULL;
} else {
@@ -987,6 +987,9 @@ Tcl_OpenObjCmd(notUsed, interp, objc, objv)
break;
}
chan = Tcl_OpenCommandChannel(interp, cmdObjc, cmdArgv, flags);
+ if (binary) {
+ Tcl_SetChannelOption(interp, chan, "-translation", "binary");
+ }
}
ckfree((char *) cmdArgv);
}