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 6092093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:24:10+00:00 2026-05-23T12:24:10+00:00

I have a file named test7.tcl: namespace eval ::dai { variable name ratzip variable

  • 0

I have a file named test7.tcl:

namespace eval ::dai {
   variable name "ratzip"
   variable birthday "1982"
   proc hello {} {
      variable name
      variable birthday
      puts "Hello, I am $name birthday is $birthday"
   }
}

and I want to source this file into another file, called test8.tcl in this way:

source test7.tcl

::dai::hello

but it gives me error: couldn’t read file “test7.tcl”: no such file or directory

but the two files are under the same folder, what happened?

  • 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-23T12:24:11+00:00Added an answer on May 23, 2026 at 12:24 pm

    To source a file that is in the same directory as the currently executing script, use this:

    source [file join [file dirname [info script]] "test7.tcl"]
    

    Note that this doesn’t work inside procedures defined inside the outer script (test8.tcl in your case) because they’re typically called after the source finishes. If that’s the case for you, the simplest fix is to just save the output of info script in a variable in your outer script (or just source all files immediately instead of lazily for the ultimately best approach).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a file named test1.cpp namespace a { int main1() { return 3;
For simplicity, i have the following file named test.jsp: <script language=javascript> alert(a$b.replace(/\$/g,k)); </script> I
I have an XML document as follows: <directory> <file><monitored>0</monitored> <xferStatus>1</xferStatus> <name>test1.txt</name> <size>7</size> <created>03/31/10 11:30:02
I have a file named my file.pdf and I can't delete this file with
I have a file,named f1.txt, whose contents are 75 15 85 35 60 50
I have a file named file with three lines: line one line two line
I have a JAR file named helloworld.jar . In order to run it, I'm
I have a jar file named umar.jar in /root/umar/bin directory. I have a shell
I have a resource file named filetypes.resx. Some how I figured out to bind
I have created a file named MyFile.db using SQLite3 from my C#.net application. This

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.