This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

lftp & get "this" file

Help for those learning Tcl or writing their own scripts.
Post Reply
h
hazzlah
Voice
Posts: 4
Joined: Fri May 13, 2011 9:54 pm

lftp & get "this" file

Post by hazzlah »

Hey Folks ,
i need some help hope everybody understood what i will then my english its really bad :-P

So i will that my eggdrop download a File whats alltime ends with *.txt.

The Dir change everytim when a new *.txt came. But this all works fine , my Problem its , in this dir a some diffrent files , some times he download the right file but sometimes he downloaded the wrong file and thats really
bad :-/

So here its the Code witch i use maybe its there a better option for string match or somethink other.

set get_filename [exec lftp -c open $ip -u $user,$password -p $port -e "cd $txtdir; ls -m1; mget -O $tmp *.txt;"]

foreach filename [split $get_filename "\n"] {

if {[string match -nocase {*.txt} $filename]} {

So hope anybody out there can help me thats he only download the files witch end with .txt and no other.

Thx
Post Reply