Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6585663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:41:29+00:00 2026-05-25T16:41:29+00:00

So I am working with a large TCL project and thought it would be

  • 0

So I am working with a large TCL project and thought it would be cool to build a treeview of how files were being source in the project. I modified the source command to do the following:

rename ::source ::real_source

proc ::source args {
    set file_handle [open "file_source.tcl" a]
    puts $file_handle $args
    puts $file_handle $argv0
    close $file_handle
    uplevel 1 ::real_source $args
}

Which works and saves all of the files being sourced but I was wondering if anyone had any ideas on how I could determine which files are calling the source command?

Another interesting issue I am running into is that my new source procedure seems to only work in some files. File A sources File B and all of the sources in File B seem to work correctly but anything under that seems to go back to using the old source procedure. Any ideas on why this is happening?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:41:30+00:00Added an answer on May 25, 2026 at 4:41 pm

    [info script] will give you the name of the file invoking source

    Example:

    a.tcl

    rename ::source ::real_source
    proc ::source args {
        puts "[info script] sources $args"
        uplevel 1 ::real_source $args
    }
    source b.tcl
    

    b.tcl

    puts "in file b"
    source c.tcl
    

    c.tcl

    puts "in file c"
    

    outputs

    a.tcl sources b.tcl
    in file b
    b.tcl sources c.tcl
    in file c
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are working on a large project with a measure of new/modified GUI functionality.
I'm working with a large (270+ project) VS.Net solution. Yes, I know this is
I am working on a large C++ project in Visual Studio 2008, and there
I've been working with large sparse files on openSUSE 11.2 x86_64. When I try
Im working on a large project, havent had to do what I need help
I am working on a large scale Rails project, and the team I am
I'm working on a large project, for which several thousand branch types are defined,
I'm currently working on large C++ Qt based project which is a about to
I'm working with large files in French and German. Basically, writing strings of characters
I'm working with large files in C# (can be up to 20%-40% of available

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.