Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 2f62b265e972c87f7d1c6840094d76d480464ae2
Ticket: 3445787fffffffffffffffffffffffffffffffff
Exposed file command broken in safe interps
User & Date: johannes-kuhn on 2012-01-09 02:26:42
Changes

  1. icomment:
    The file command is now a namespace ensemble (see [namespace ensemble configure file]).
    All subcommands of file are now hidden with a name like tcl:file:atime. (Original name with all namespace seperators (::) replaced by a single colon(:))
    
    This change does in fact break old scripts that uses [interp invokehidden $interp file].
    
    The safe base uses the trused interp's file command, this is ok because the exposed command does not have any special treatment depending on the interp, unlike [file channels] witch displays all open channels that this interp has access to.
    
    This might probably only a small amout of scripts that actually 1) does not use the safe base and 2) use safe interps with (partialy) exposed file commands.
    
    My advise is: make [interp hide] namespace aware, and when a hidden namespace enseble is called (like [file]) it should _first_ check if the target command (e.g. [::tcl::file::atime]) is there and call that command. If there is no such hidden command  it should check if there is an exposed command with that name.
    
    I think this is the only possible solution to have still backward compatibility and [file] a namespace ensemble
    
    
  2. login: "johannes-kuhn"
  3. mimetype: "text/plain"
  4. username: "johannes-kuhn"