PDA

View Full Version : iTCL argument question (filename, not path)


CP-Geek
02-10-2005, 10:51 AM
Regarding THIS (http://www.ioftpd.com/board/showthread.php?s=&threadid=4052) discussion, I'm using a .itcl script: ##!

catch {putlog "UPDATE: \"$pwd\" \"\002$user\002 uploaded \002 [lindex $args 2] \002\""}

##end

and it works, the line it returns to irc is <@FTP-Bot> Geek uploaded /Uploadz/Misc/Test/test.exe

(How can I add "@ 123 KB/s" in the end of that?)

BUT, I'd like to remove the path, so the result would be only <@FTP-Bot> Geek uploaded test.exe

But how? I'm so newbie in TCL so it's unbelievable :rolleyes:

Any ideas?

CP :)

jeza
02-10-2005, 05:13 PM
catch {putlog "UPDATE: \"$pwd\" \"\002$user\002 uploaded \002 [lindex [split [lindex $args 2] "/"] end] @ $speed\002\""}

CP-Geek
02-10-2005, 05:24 PM
Thankz jeza!

Only prob is that now I have to cut the decimals from the speed-display: Geek uploaded test.exe @ 189.151197475

Gotta do some reading again :)

jeza
02-10-2005, 05:26 PM
catch {putlog "UPDATE: \"$pwd\" \"\002$user\002 uploaded \002 [lindex [split [lindex $args 2] "/"] end]\002 @ \002[format %.0f $speed]\002\""}

[format %.2f $speed] = 2 decimals

CP-Geek
02-10-2005, 05:34 PM
wow, Your fast. Mu most humble thanks! Works very nicely indeed.

CP :)