PDA

View Full Version : i need a function......


lidaof
02-21-2005, 09:20 AM
now i have a .intro file under a Divx dir,which is an introduction of the Divx
i want to show those words of the .intro in ftp client's message window when i list the Divx dir....like glftpd...

thanks&forgive my poor english...

wooolF[RM]
02-21-2005, 09:29 AM
rename .intro to .ioFTPD.message

lidaof
02-21-2005, 09:47 AM
so strange...

cann't rename .intro to .ioFTPD.message

it said i must insert the file's name

i use windows xp sp2

jeza
02-21-2005, 10:07 AM
rename .intro to intro and than in ftp client rename to .ioFTPD.message

lidaof
02-21-2005, 10:20 AM
[L] RNFR intro
[L] 350 File exists, ready for destination name.
[L] RNTO .ioFTPD.message
[L] 550 .ioFTPD.message: Invalid filename.
Rename Failure!

Harm
02-21-2005, 12:21 PM
You can't create or move files starting with a dot in windows explorer.
The suggestion goes for further uploads. Edit your scripts to use .ioFTPD.message instead of .intro.
You could also use a script that outputs the content of your .intro file to the user on CWD. Though, files starting with a dot aren't always hidden in the windows environment so using a filename starting with .ioFTPD will ensure that the files won't be seen by your users.

lidaof
02-22-2005, 05:44 AM
Originally posted by Harm
You can't create or move files starting with a dot in windows explorer.
The suggestion goes for further uploads. Edit your scripts to use .ioFTPD.message instead of .intro.
You could also use a script that outputs the content of your .intro file to the user on CWD. Though, files starting with a dot aren't always hidden in the windows environment so using a filename starting with .ioFTPD will ensure that the files won't be seen by your users.

which script can output the content of the .intro or .ioFTPD file?

i am really a newbie....thank u~

Harm
02-22-2005, 12:19 PM
.ioFTPD.message files are automatically displayed to the users on CWD.
To show the content of the .intro files, you would have to use something like :

showintro.itcl:

proc showintro {} {
global pwd
set introfile [glob -nocomplain -types f [file join [resolve pwd $pwd] ".intro"]]
if {[llength $introfile]==1} {
set intro [open [lindex $introfile 0] r]; set content [split [read $intro] \n]; close $intro
foreach line $content {iputs -nobuffer "250- $line"}
}
return 0
}

return [showintro]


ioFTPD.ini

[FTP_Post-Command_Events]
cwd = TCL C:\ioFTPD\scripts\showintro.itcl

deo
02-22-2005, 03:20 PM
or even in showintro.itcl


catch {set fd [open $path/.intro r] ; iputs [read $fd] ; close $fd}

lidaof
02-22-2005, 11:53 PM
thank all above,specially Harm&deo~

another quetion,which script can rename .intro to .ioFTPD.message automatically?

:) ,if it already exist...


thanks again..........

lidaof
02-23-2005, 12:23 AM
it works well,hehe,3x so much

with that script i also can show the content of the .imdb which contains some iMDB information about this movie...

Harm
02-28-2005, 03:02 AM
You could try this.

renameintro.itcl:
set ri(paths) "/private /groups"

proc renameintro {vfspath path} {
set dirs [glob -nocomplain -type d "$path/*"]
foreach dir $dirs {
iputs -nobuffer "Checking $vfspath."
if {![file exists [file join $path ".intro"]]} {
renameintro "$vfspath/[lindex [split $dir /] end]" "$dir"
} else {
catch {file rename -force [file join $path ".intro"] [file join $path ".ioFTPD.message"]}
}
}
return 0
}

foreach path $ri(paths) {renameintro "$path" "[resolve pwd $path]"}
return 0

ioFTPD.ini:
[FTP_Custom_Commands]
RENAMEINTO = TCL C:\ioFTPD\scripts\renameintro.itcl

[FTP_SITE_Permissions]
RENAMEINTRO = M