Artifacts Associated With Ticket 218560
Ticket change [20bc2c78ed] (rid 130472) by nobody on 2000-10-26 01:02:18:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
OriginalBugID: 1113 RFE Version: 8.0.4 SubmitDate: '1999-01-26' LastModified: '1999-02-02' Severity: SER Status: Released Submitter: welch ChangedBy: stanton OS: Other OSVersion: any platform Machine: NA FixedDate: '1999-02-02' FixedInVersion: 8.0.5 ClosedDate: '2000-10-25' Name: Jan Nijtmans DesiredBehavior: The "open" command in tclIOCmd.c, is implemented as an old-style command, using argv and argc for the arguments. This requests is about objectifying the "source" command, such that the arguments become available as Tcl_Obj's. Patch: *** generic/tclInt.h.origSun Jan 17 15:37:10 1999 --- generic/tclInt.hSun Jan 17 15:37:46 1999 *************** *** 1784,1791 **** Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); EXTERN intTcl_NamespaceObjCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); ! EXTERN intTcl_OpenCmd _ANSI_ARGS_((ClientData clientData, ! Tcl_Interp *interp, int argc, char **argv)); EXTERN intTcl_PackageCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, int argc, char **argv)); EXTERN intTcl_PidObjCmd _ANSI_ARGS_((ClientData clientData, --- 1784,1791 ---- Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); EXTERN intTcl_NamespaceObjCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); ! EXTERN intTcl_OpenObjCmd _ANSI_ARGS_((ClientData clientData, ! Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); EXTERN intTcl_PackageCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, int argc, char **argv)); EXTERN intTcl_PidObjCmd _ANSI_ARGS_((ClientData clientData, *** generic/tclBasic.c.origSun Jan 17 15:38:35 1999 --- generic/tclBasic.cSun Jan 17 15:39:28 1999 *************** *** 188,194 **** (CompileProc *) NULL,1}, {"glob",Tcl_GlobCmd,(Tcl_ObjCmdProc *) NULL, (CompileProc *) NULL,0}, ! {"open",Tcl_OpenCmd,(Tcl_ObjCmdProc *) NULL, (CompileProc *) NULL,0}, {"pid",(Tcl_CmdProc *) NULL,Tcl_PidObjCmd, (CompileProc *) NULL,1}, --- 188,194 ---- (CompileProc *) NULL,1}, {"glob",Tcl_GlobCmd,(Tcl_ObjCmdProc *) NULL, (CompileProc *) NULL,0}, ! {"open",(Tcl_CmdProc *) NULL,Tcl_OpenObjCmd, (CompileProc *) NULL,0}, {"pid",(Tcl_CmdProc *) NULL,Tcl_PidObjCmd, (CompileProc *) NULL,1}, *** generic/tclIOCmd.c.origSun Jan 17 15:30:39 1999 --- generic/tclIOCmd.cSun Jan 17 15:30:43 1999 *************** *** 965,999 **** /* ARGSUSED */ int ! Tcl_OpenCmd(notUsed, interp, argc, argv) ClientData notUsed;/* Not used. */ Tcl_Interp *interp;/* Current interpreter. */ int argc;/* Number of arguments. */ ! char **argv;/* Argument strings. */ { int pipeline, prot; ! char *modeString; Tcl_Channel chan; if ((argc < 2) || (argc > 4)) { ! Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], ! " fileName ?access? ?permissions?\"", (char *) NULL); return TCL_ERROR; } prot = 0666; if (argc == 2) { modeString = "r"; } else { ! modeString = argv[2]; if (argc == 4) { ! if (Tcl_GetInt(interp, argv[3], &prot) != TCL_OK) { return TCL_ERROR; } } } pipeline = 0; ! if (argv[1][0] == '|') { pipeline = 1; } --- 965,999 ---- /* ARGSUSED */ int ! Tcl_OpenObjCmd(notUsed, interp, argc, objv) ClientData notUsed;/* Not used. */ Tcl_Interp *interp;/* Current interpreter. */ int argc;/* Number of arguments. */ ! Tcl_Obj * CONST objv[];/* Argument objects. */ { int pipeline, prot; ! char *modeString, *arg1; Tcl_Channel chan; if ((argc < 2) || (argc > 4)) { ! Tcl_WrongNumArgs(interp, 1, objv, "fileName ?access? ?permissions?"); return TCL_ERROR; } prot = 0666; if (argc == 2) { modeString = "r"; } else { ! modeString = Tcl_GetStringFromObj(objv[2], NULL); if (argc == 4) { ! if (Tcl_GetIntFromObj(interp, objv[3], &prot) != TCL_OK) { return TCL_ERROR; } } } + arg1 = Tcl_GetStringFromObj(objv[1], NULL); pipeline = 0; ! if (arg1[0] == '|') { pipeline = 1; } *************** *** 1002,1011 **** */ if (!pipeline) { ! chan = Tcl_OpenFileChannel(interp, argv[1], modeString, prot); } else { #ifdef MAC_TCL ! Tcl_AppendResult(interp, "command pipelines not supported on Macintosh OS", (char *)NULL); return TCL_ERROR; --- 1002,1011 ---- */ if (!pipeline) { ! chan = Tcl_OpenFileChannel(interp, arg1, modeString, prot); } else { #ifdef MAC_TCL ! Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "command pipelines not supported on Macintosh OS", (char *)NULL); return TCL_ERROR; *************** *** 1013,1019 **** int mode, seekFlag, cmdArgc; char **cmdArgv; ! if (Tcl_SplitList(interp, argv[1]+1, &cmdArgc, &cmdArgv) != TCL_OK) { return TCL_ERROR; } --- 1013,1019 ---- int mode, seekFlag, cmdArgc; char **cmdArgv; ! if (Tcl_SplitList(interp, arg1+1, &cmdArgc, &cmdArgv) != TCL_OK) { return TCL_ERROR; } *************** *** 1045,1051 **** return TCL_ERROR; } Tcl_RegisterChannel(interp, chan); ! Tcl_AppendResult(interp, Tcl_GetChannelName(chan), (char *) NULL); return TCL_OK; } --- 1045,1052 ---- return TCL_ERROR; } Tcl_RegisterChannel(interp, chan); ! Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), ! Tcl_GetChannelName(chan), (char *) NULL); return TCL_OK; } PatchFiles: tclInt.h tclBasic.c tclIOCmd.c This change is crucial for a new extension I am writing, therefore I request that it will be implemented in Tcl8.0.5, and not delayed until Tcl8.1. It's difficult to explain in a few words why, but you'll read it in the announcement. The patch shows that implementation of this feature is trivial. - foundin initialized to: "obsolete: 8.0.4"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "69. Other"
- title initialized to: "Objectify the "open" command"
- type initialized to: "RFE"
Ticket change [031b104284] (rid 119762) by welch on 2000-10-26 08:24:14:
- closedate changed to: "2000-10-26T01:24:14"
- closer changed to: "welch"
- priority changed to: "2"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [71a87727d7] (rid 100725) by dgp on 2001-04-16 23:21:50:
- foundin changed to: "None"
- status changed to: "Open"
- subsystem changed to: "None"
- title changed to: "Objectify the "open" command"
Ticket change [b2d1d1413b] (rid 98407) by dgp on 2001-04-16 23:22:12:
- closedate changed to: "2001-04-16T16:22:12"
- closer changed to: "dgp"
- status changed to: "Closed"
- subsystem changed to: "24. Channel Commands"
- title changed to: "Objectify the "open" command"