summaryrefslogtreecommitdiffstats
path: root/generic/tclFCmd.c
diff options
context:
space:
mode:
authorkjnash <k.j.nash@usa.net>2022-09-15 14:58:59 (GMT)
committerkjnash <k.j.nash@usa.net>2022-09-15 14:58:59 (GMT)
commit9e810a504500232f79a23de35a33127dc19bd34b (patch)
tree075ab3f448d6e167ba88e6aa574cce3c881b44e2 /generic/tclFCmd.c
parentaca6eed0f36ee531e3e3c8eeb6c6c966ad80057f (diff)
parent0371b9ed8d4bd0943122234faf1c03cfc14b3405 (diff)
downloadtcl-9e810a504500232f79a23de35a33127dc19bd34b.zip
tcl-9e810a504500232f79a23de35a33127dc19bd34b.tar.gz
tcl-9e810a504500232f79a23de35a33127dc19bd34b.tar.bz2
Merge 8.7
Diffstat (limited to 'generic/tclFCmd.c')
-rw-r--r--generic/tclFCmd.c76
1 files changed, 76 insertions, 0 deletions
diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c
index 6eb6644..2d24207 100644
--- a/generic/tclFCmd.c
+++ b/generic/tclFCmd.c
@@ -1650,6 +1650,82 @@ TclFileTempDirCmd(
}
/*
+ *----------------------------------------------------------------------
+ *
+ * TclFileHomeCmd --
+ *
+ * This function is invoked to process the "file home" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TclFileHomeCmd(
+ TCL_UNUSED(void *),
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *const objv[])
+{
+ Tcl_Obj *homeDirObj;
+
+ if (objc != 1 && objc != 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "?user?");
+ return TCL_ERROR;
+ }
+ homeDirObj = TclGetHomeDirObj(interp, objc == 1 ? NULL : Tcl_GetString(objv[1]));
+ if (homeDirObj == NULL) {
+ return TCL_ERROR;
+ }
+ Tcl_SetObjResult(interp, homeDirObj);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TclFileTildeExpandCmd --
+ *
+ * This function is invoked to process the "file tildeexpand" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TclFileTildeExpandCmd(
+ TCL_UNUSED(void *),
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *const objv[])
+{
+ Tcl_Obj *expandedPathObj;
+
+ if (objc != 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "path");
+ return TCL_ERROR;
+ }
+ expandedPathObj = TclResolveTildePath(interp, objv[1]);
+ if (expandedPathObj == NULL) {
+ return TCL_ERROR;
+ }
+ Tcl_SetObjResult(interp, expandedPathObj);
+ return TCL_OK;
+}
+
+/*
* Local Variables:
* mode: c
* c-basic-offset: 4