#4518 Non-configurable tempdir for child stderr

obsolete: 8.5.12

When using [exec] or [open|] without a 2> or 2>@ redirection, the child's file descriptor 2 flows into a temporary file, but the directory used is not configurable (P_tempdir, typically "/tmp"). This causes headaches to people operating in restricted environments where /tmp is not writable:


I think that the old function TclpCreateTempFile doing this should either be dropped in favour of something like TclpOpenTemporaryFile, or fixed to call the same, flexible tempdir function DefaultTempDir() (currently unix, but should be ppromoted to platform-agnostic).


  • Donal K. Fellows

    • milestone: --> obsolete: 8.5.12
    • priority: 5 --> 9
    • assigned_to: vincentdarley --> dkf
  • Donal K. Fellows

    Causing problems for people using Tcl to develop on iOS, so needs regularization of this code (which is currently triplicated...)

  • Donal K. Fellows

    Fix will be substantively different on 8.5 and 8.6 (as 8.6 has more machinery here); prioritizing 8.6 fix first.

  • Donal K. Fellows

    • status: open --> closed-fixed
  • Donal K. Fellows

    Fixed on all production branches.

    Now respects TMPDIR environment variable, and the default fallback (if that isn't provided and P_tmpdir isn't writable) can be set via the TCL_TEMPORARY_FILE_DIRECTORY preprocessor symbol (which needs to be a string constant).


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks