Go Back   FlashFXP Forums > > > >

! Requests Need a script or some sort of cool .bat file ? Ask here!

Reply
 
Thread Tools Rate Thread Display Modes
Old 10-16-2004, 03:08 PM   #1
tX
Member
FlashFXP Registered User
ioFTPD Foundation User
 
Join Date: Jan 2004
Posts: 27
Default [Filled] Additional code for ioNEWDIR to export Newdirs

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 is offline   Reply With Quote
Old 10-18-2004, 11:16 AM   #2
tX
Member
FlashFXP Registered User
ioFTPD Foundation User
 
Join Date: Jan 2004
Posts: 27
Default

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):

Code:
	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?
tX is offline   Reply With Quote
Old 10-18-2004, 08:07 PM   #3
bizniz
Banned
 
Join Date: Feb 2004
Posts: 19
Default

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

Code:
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"
}
bizniz is offline   Reply With Quote
Old 10-19-2004, 10:47 AM   #4
tX
Member
FlashFXP Registered User
ioFTPD Foundation User
 
Join Date: Jan 2004
Posts: 27
Default

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.
tX is offline   Reply With Quote
Old 10-19-2004, 01:02 PM   #5
bizniz
Banned
 
Join Date: Feb 2004
Posts: 19
Default

blehg, put another tcl _before_ the existing newdir to delete .message

Code:
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}
bizniz is offline   Reply With Quote
Old 10-19-2004, 03:21 PM   #6
tX
Member
FlashFXP Registered User
ioFTPD Foundation User
 
Join Date: Jan 2004
Posts: 27
Default

Thx, didn't tried that with a second itcl, hope it will work everytime ^^
tX is offline   Reply With Quote
Old 10-20-2004, 11:18 AM   #7
tX
Member
FlashFXP Registered User
ioFTPD Foundation User
 
Join Date: Jan 2004
Posts: 27
Default

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]
tX is offline   Reply With Quote
Old 10-21-2004, 08:11 AM   #8
bizniz
Banned
 
Join Date: Feb 2004
Posts: 19
Default

Code:
%\[execute\(TCL ..\\scripts\\prenew.itcl\)\]
%\[execute\(TCL ..\\scripts\\ioNEWDIR.itcl 25 / 250-\)\]
try that..
bizniz is offline   Reply With Quote
Old 10-21-2004, 11:25 AM   #9
tX
Member
FlashFXP Registered User
ioFTPD Foundation User
 
Join Date: Jan 2004
Posts: 27
Default

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.
tX is offline   Reply With Quote
Reply

Tags
additional, code, export, ionewdir, newdirs

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT -5. The time now is 03:43 PM.

Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)