Contents
How do I change directories in TCL?
5 Answers. you can just use the TCL commands cd and pwd. That should be all you need. See http://www.tcl.tk/man/tcl8.5/TclCmd/cd.htm for more info.
What is glob in Tcl?
This command performs file name “globbing” in a fashion similar to the csh shell or bash shell. It returns a list of the files whose names match any of the pattern arguments. No particular order is guaranteed in the list, so if a sorted list is required the caller should use lsort.
How to check file existence using Tcl script?
An alternative method that I’m trying to pursue, is that when I do a dir using the tcl script. I will get an output of all the files in the directory. I just need to match my file with the list outputted and satisfy the if when a match was found I’m executing the script from Location A, but using the script to telnet to Location B.
How to create a directory if it doesn’t exist?
If it doesn’t exist I want to create but I get the error mkdir: cannot create directory’./’ File exists My code says that the file exists even though it doesn’t. What am I doing wrong? echo “Enter directory name” read dirname if [ [ ! -d “$dirname” ]] then if [ -L $dirname] then echo “File doesn’t exist.
How to delete a non-empty file in Tcl?
Removes the file or directory specified by each pathname argument. Non-empty directories will be removed only if the -force option is specified. Trying to delete a non-existant file is not considered an error. Trying to delete a read-only file will cause the file to be deleted, even if the -force flags is not specified.
Why does TCL return platform-specific name of file?
If the file doesn’t exist or its modified time cannot be queried then an error is generated. Returns the platform-specific name of the file. This is useful if the filename is needed to pass to a platform-specific call, such as exec under Windows or AppleScript on the Macintosh.