Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 06-06-2004, 09:19 PM   #1
Registered: May 2003
Posts: 256

Rep: Reputation: 30
Question Checking file extension in TCL?

Is there a TCL command to check file extension, ie., file.c, file.ksh?

Please advise
Old 06-12-2004, 08:43 PM   #2
Registered: Oct 2002
Location: Bangalore
Distribution: Gentoo Linux
Posts: 96

Rep: Reputation: 16

I don't know what you mean by "TCL command to ...". But, you can do what you want with a couple of lines in TCL.

set test ""
string range $test [string last . $name] end


string range $test [expr 1 + [string last . $test]] end

Old 06-14-2004, 06:38 AM   #3
Registered: May 2003
Posts: 256

Original Poster
Rep: Reputation: 30
Wink file extension $filename

I found it...

file extension $filename


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux file extension vs Dos file Extension? manaa Linux - Newbie 6 02-12-2009 04:19 PM
File extension...?? jojojo Linux - Newbie 1 05-23-2005 04:42 PM
why when redirecting output to a file any file extension seems to be fine? dr_zayus69 Linux - General 1 05-21-2005 04:09 AM
naming a Tcl file liguorir Linux - Software 1 05-20-2004 08:47 PM
file extension help Netrack Linux - Newbie 9 01-21-2003 08:53 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:52 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration