Group Listing of Commands

This section briefly lists all Tcl commands, grouped logically by function.

Control Statements

break

Abort innermost containing loop command.

case

Obsolete, see switch.

continue

Skip to next iteration of innermost containing loop command.

exit

Terminate process.

for

Loop based on an expression.

foreach

Loop over each element of a list.

if

Conditional evaluation.

return

Return from procedure.

switch

Evaluation based on pattern match.

while

Loop based on a condition being true.

File Manipulation

file atime

Return file access time.

file mtime

Return file modification time.

file attributes

Set or get platform-dependent file attributes.

file copy

Make copy of a file or directory.

file delete

Remove file or directory.

file dirname

Return directory portion of pathname.

file executable

Return 1 if file is executable, 0 otherwise.

file exists

Return 1 if file exists, 0 otherwise.

file isdirectory

Return 1 if file is a directory, 0 otherwise.

file isfile

Return 1 if file is a regular file, 0 otherwise.

file owned

Return 1 if file is owned by current user, 0 otherwise.

file readable

Return 1 if file is readable by current user, 0 otherwise.

file writable

Return 1 if file is writable by current user, 0 otherwise.

file extension

Return characters after and including last period.

file join

Combine arguments with path separator to form pathname.

file mkdir

Create a directory.

file nativename

Return platfor m-specific filename.

file pathtype

Return type of path: absolute, relative, or volumerelative.

file readlink

Return value ...

Get Tcl/Tk in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.