summaryrefslogtreecommitdiffstats
path: root/mac/tclMacChan.c
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2001-08-30 08:53:14 (GMT)
committervincentdarley <vincentdarley>2001-08-30 08:53:14 (GMT)
commit209cbd9eea8f0938d87548bdea9bd8970d18a1fb (patch)
treecf952115d99a903d3c817b01278505ed6aaff55d /mac/tclMacChan.c
parentea7d3c538d82fb64a201fedfb9376f6dcafbd102 (diff)
downloadtcl-209cbd9eea8f0938d87548bdea9bd8970d18a1fb.zip
tcl-209cbd9eea8f0938d87548bdea9bd8970d18a1fb.tar.gz
tcl-209cbd9eea8f0938d87548bdea9bd8970d18a1fb.tar.bz2
filesystem
Diffstat (limited to 'mac/tclMacChan.c')
-rw-r--r--mac/tclMacChan.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/mac/tclMacChan.c b/mac/tclMacChan.c
index 2fbac8f..e728c7f 100644
--- a/mac/tclMacChan.c
+++ b/mac/tclMacChan.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclMacChan.c,v 1.6 1999/04/16 00:47:19 stanton Exp $
+ * RCS: @(#) $Id: tclMacChan.c,v 1.7 2001/08/30 08:53:15 vincentdarley Exp $
*/
#include "tclInt.h"
@@ -753,7 +753,7 @@ Tcl_Channel
TclpOpenFileChannel(
Tcl_Interp *interp, /* Interpreter for error reporting;
* can be NULL. */
- char *fileName, /* Name of file to open. */
+ Tcl_Obj *pathPtr, /* Name of file to open. */
char *modeString, /* A list of POSIX open modes or
* a string such as "rw". */
int permissions) /* If the open involves creating a
@@ -763,7 +763,6 @@ TclpOpenFileChannel(
Tcl_Channel chan;
int mode;
char *native;
- Tcl_DString ds, buffer;
int errorCode;
mode = GetOpenMode(interp, modeString);
@@ -771,20 +770,18 @@ TclpOpenFileChannel(
return NULL;
}
- if (Tcl_TranslateFileName(interp, fileName, &buffer) == NULL) {
+ native = Tcl_FSGetNativePath(pathPtr);
+ if (native == NULL) {
return NULL;
}
- native = Tcl_UtfToExternalDString(NULL, Tcl_DStringValue(&buffer),
- Tcl_DStringLength(&buffer), &ds);
chan = OpenFileChannel(native, mode, permissions, &errorCode);
- Tcl_DStringFree(&ds);
- Tcl_DStringFree(&buffer);
if (chan == NULL) {
Tcl_SetErrno(errorCode);
if (interp != (Tcl_Interp *) NULL) {
- Tcl_AppendResult(interp, "couldn't open \"", fileName, "\": ",
- Tcl_PosixError(interp), (char *) NULL);
+ Tcl_AppendResult(interp, "couldn't open \"",
+ Tcl_GetString(pathPtr), "\": ",
+ Tcl_PosixError(interp), (char *) NULL);
}
return NULL;
}