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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

directory

Status
Not open for further replies.

rmad

IS-IT--Management
Apr 10, 2007
1
0
0
IN
Does someone know how to write into a file the file-list in a specific directory from tcl script?
 
To get a list of the files in directory /tmp/abcd:

set file_list [glob -nocomplain /tmp/abcd/*]

To write the list to a file, simply open a file for write and run through file_list with a foreach. If you need more info than just the file name, you can use the "file" command to get file type, permissions, etc.

Good luck,

Jeff.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top