Tcl built-ins for cross platform functionality

Purpose: to document the various Tcl commands available to perform functions for which programmers commonly think they need external commands.

  • clock instead of external commands for date or time
  • glob instead of external commands for file listing commands like dir or ls
  • file copy, delete, rename...
  • open/read/close instead of external commands for reading files
  • tcllib's fileutil has procs for cat, find, and grep
  • while it isn't built in, see tail for info on doing basic 'read me the end of a file' type processing.
  • see diff for info on comparing files via tcl code
  • auto_execok is handy for platform independant shell execution of commands.

See also What should I be sure to do so my Tcl based programs run cross platform.

On the C level, see: Tcl Portable Runtime Library, which is the foundation to the Tcl level commands listed above.