summaryrefslogtreecommitdiffstats
path: root/generic/tclFCmd.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-09-16 08:33:59 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-09-16 08:33:59 (GMT)
commit3befacd1faf0215dbb567f3251b4976e69b3354f (patch)
treeb84aa71c4424f1e74059a8feaeb1ca68422d7631 /generic/tclFCmd.c
parent440683ce1ea54b52265ddd624e9179f52fee75b6 (diff)
parentd171543388eb0149647f980eb25c80a9bfdadd1e (diff)
downloadtcl-3befacd1faf0215dbb567f3251b4976e69b3354f.zip
tcl-3befacd1faf0215dbb567f3251b4976e69b3354f.tar.gz
tcl-3befacd1faf0215dbb567f3251b4976e69b3354f.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