PDA

View Full Version : [Filled] Additional code for ioNEWDIR to export Newdirs


tX
10-16-2004, 03:08 PM
Hi,

I am searching for additional code for the known script ioNEWDIR to export the NEWDIR's in a secondary file to display it wherever I want.

How to solve this? Thanks in advance.

tX
10-18-2004, 11:16 AM
I've tried something like this (code is changed a lil bit by my self)

This is the important part which creates the output of the NewDir Events (Releases):

if {$newdir(style)} {
set what "[format %-76s [string range $release 0 75]]"
set and ""
set outfile [open "$newdir(dirfile)" w]
regsub -all 0 $and o and
output "$what$and"
puts $outfile "$what$and"
close $outfile
} else {
iputs "$newdir(pre) \[[format %02s [expr $x +1]]\] [format %-7s [lrange $old 0 1]] [format %-7s $owner] [format %3s $files]F [format %7s [fixmeg $size]] $release"
}

The red lines are my code.


Now let me explain. It brings only the last release of the default SITE NEW Execution.

If you type in SITE NEW and it brings, for an example the following one:

Release_Nr_1-GRP
Release_Me_yaaa-GRP
Relesaing_makes_fun-GRP

It will just save the following in a external file:

Relesaing_makes_fun-GRP

But why?

bizniz
10-18-2004, 08:07 PM
what exactly are you trying to do?? if u wanna make anohter file some where else, say .ioFTPD.message in another dir so it has all the release listed in it when dir is entered, try


set filename "c:/site/r00t/_newdirs/.ioFTPD.message"

proc extra_list {release} {global filename
if {[catch {set fd [open $filename a+]} error] == 0} {
catch {puts $fd $release}
catch {close $fd}
return 0
}
}

if {$newdir(style)} {
extra_list [format %-76.76s $release]
} else {
iputs "$newdir(pre) \[[format %02s [expr $x +1]]\] [format %-7s [lrange $old 0 1]] [format %-7s $owner] [format %3s $files]F [format %7s [fixmeg $size]] $release"
}

tX
10-19-2004, 10:47 AM
Works, but another problem....

how to clean up this file before next SITE NEW Command, because it adds the releases to this file if i use site new again.

bizniz
10-19-2004, 01:02 PM
blehg, put another tcl _before_ the existing newdir to delete .message


in ioFTPD.ini
[site_cmds]
new = TCL ../scripts/prenew.itcl
new = TCL ../scripts/ioNEWD...
[site_perms]
new = * !=A

prenew.itcl
set filename "c:/site/r00t/_newdirs/.ioFTPD.message"
catch {file delete -force -- $filename}

tX
10-19-2004, 03:21 PM
Thx, didn't tried that with a second itcl, hope it will work everytime ^^

tX
10-20-2004, 11:18 AM
hmm, another problem.
I've added

%[execute(TCL ..\scripts\ioNEWDIR.itcl 25 / 250-)]

to the Welcome message file, to display the newest stuff everytime someone logins. But in this way the prenew.itcl doesn't work, and it doesn't delete the file. Only if i type in manually SITE NEW it will work :/

and this before also won't work.

%[execute(TCL ..\scripts\prenew.itcl]

bizniz
10-21-2004, 08:11 AM
%\[execute\(TCL ..\\scripts\\prenew.itcl\)\]
%\[execute\(TCL ..\\scripts\\ioNEWDIR.itcl 25 / 250-\)\]


try that..

tX
10-21-2004, 11:25 AM
I don't think that will help, generally it works without slashes, but it duplicates on every login the external file content.

Release-1
Release-2
Release-1
Release-2

and prenew doesn't delete the old.

Sorry, not correct explained above.