Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question about File Names

Status
Not open for further replies.

Alyfc

Programmer
Sep 8, 2003
1
US
Hi,
I've been trying to figure out how to get the full path and file name of a calling proc and am starting to think it might be impossible.
I am writing a simple program that is called by a procedure and writes to the output the name of the calling procedure and the date and time it was started. But i can't seem to get a pathname. Is this because it was sourced in and now I am merely calling a command?
Does anyone know a trick that might help me figure out the full filename and path of the calling proc?
Alyssa
 
You can add this command in head of each of the sourced files (procs should contain the list of all the procs name defined in the file):
Code:
  set path [info script]
  set procs {proc1 proc2 proc3}
  foreach proc $procs { set ::procfile($proc) $path }
When you need the file path of $proc, do:
Code:
  set path $::profile($proc)
HTH

ulis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top