Purpose: gather together tips on writing portable Tcl and Tk programs that will more likely run on many platforms.

  • See these PostScript files for observations on portable Tcl coding.

ftp://tcl.activestate.com/pub/tcl/doc/portable-tk.ps and ftp://tcl.activestate.com/pub/tcl/doc/portable-tk-slides.ps

  • Stay away from platform specific extensions, including DDE, Registry and AppleScript.
  • See Microsoft Windows for some information about windows.
  • Use file rather than exec or self parsing file names, etc.
  • Avoid exec, because different OSs support widely different commands.
  • Avoid depending on console, which currently is not available on Unix.
  • Avoid puts to stdout and stderr (especially in library code), which might not be available for graphical applications on Microsoft Windows and MacOS.
  • Make certain your code can accomodate file paths with spaces in them.

Category Porting