summaryrefslogtreecommitdiffstats
path: root/win/tclWinChan.c
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2002-07-08 10:08:57 (GMT)
committervincentdarley <vincentdarley>2002-07-08 10:08:57 (GMT)
commit6cf4fe89feaa9ef6da9ddded6f2199f76d00e73e (patch)
tree44cae45dd1f262fcc31e6d07b240050fb7e44481 /win/tclWinChan.c
parent11a54cb010fa27ab006f13181b40da00a4f87550 (diff)
downloadtcl-6cf4fe89feaa9ef6da9ddded6f2199f76d00e73e.zip
tcl-6cf4fe89feaa9ef6da9ddded6f2199f76d00e73e.tar.gz
tcl-6cf4fe89feaa9ef6da9ddded6f2199f76d00e73e.tar.bz2
fs cleanup
Diffstat (limited to 'win/tclWinChan.c')
-rw-r--r--win/tclWinChan.c28
1 files changed, 4 insertions, 24 deletions
diff --git a/win/tclWinChan.c b/win/tclWinChan.c
index 530492d..aa156bf 100644
--- a/win/tclWinChan.c
+++ b/win/tclWinChan.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: tclWinChan.c,v 1.23 2002/05/24 21:19:09 dkf Exp $
+ * RCS: @(#) $Id: tclWinChan.c,v 1.24 2002/07/08 10:08:58 vincentdarley Exp $
*/
#include "tclWinInt.h"
@@ -744,18 +744,17 @@ FileGetHandleProc(instanceData, direction, handlePtr)
*/
Tcl_Channel
-TclpOpenFileChannel(interp, pathPtr, modeString, permissions)
+TclpOpenFileChannel(interp, pathPtr, mode, permissions)
Tcl_Interp *interp; /* Interpreter for error reporting;
* can be NULL. */
Tcl_Obj *pathPtr; /* Name of file to open. */
- CONST char *modeString; /* A list of POSIX open modes or
- * a string such as "rw". */
+ int mode; /* POSIX mode. */
int permissions; /* If the open involves creating a
* file, with what modes to create
* it? */
{
Tcl_Channel channel = 0;
- int seekFlag, mode, channelPermissions;
+ int channelPermissions;
DWORD accessMode, createMode, shareMode, flags, consoleParams, type;
CONST TCHAR *nativeName;
DCB dcb;
@@ -764,11 +763,6 @@ TclpOpenFileChannel(interp, pathPtr, modeString, permissions)
TclFile readFile = NULL;
TclFile writeFile = NULL;
- mode = TclGetOpenMode(interp, modeString, &seekFlag);
- if (mode == -1) {
- return NULL;
- }
-
nativeName = (TCHAR*) Tcl_FSGetNativePath(pathPtr);
if (nativeName == NULL) {
return NULL;
@@ -937,20 +931,6 @@ TclpOpenFileChannel(interp, pathPtr, modeString, permissions)
break;
}
- if (channel != NULL) {
- if (seekFlag) {
- if (Tcl_Seek(channel, 0, SEEK_END) < 0) {
- if (interp != (Tcl_Interp *) NULL) {
- Tcl_AppendResult(interp,
- "could not seek to end of file on \"",
- channelName, "\": ", Tcl_PosixError(interp),
- (char *) NULL);
- }
- Tcl_Close(NULL, channel);
- return NULL;
- }
- }
- }
return channel;
}