PDA

View Full Version : ioDLcount 1.0


mr_F_2
08-23-2004, 12:37 AM
don't know if this is out there yet (couldn't find it)

1) What is it

A simple script to tell a user, after retreiving a file, how many other users have retrieved that file

ie:

[L] RETR hmc-cd2-diesel.part03.rar
[L] 150 Opening BINARY mode data connection for hmc-cd2-diesel.part03.rar.
[L] 226-Total of 30 MB downloaded in 2 files.
[L] 226-.-=======================================

Means that the file is 15 MB, and it has been downloaded twice.


get in ioFTPD scripts section

peace

MaZza_Dj
08-23-2004, 04:54 AM
Hi guy,
nice this option in one ftp...
for install the ioDLcount.exe?

OnDownloadComplete = EXEC ..\scripts\ioDLcount.exe

is right?

mr_F_2
08-23-2004, 11:55 AM
Originally posted by MaZza_Dj

for install the ioDLcount.exe?

OnDownloadComplete = EXEC ..\scripts\ioDLcount.exe

is right?

no it's
OnDownloadComplete = EXEC ..\scripts\ioDLcount.exe w

MaZza_Dj
08-23-2004, 04:14 PM
yes work 8))))
coool
nice script thanks 8)))

Grendel
08-24-2004, 06:51 AM
It works well for me too...

Big THX and a

:banana: :banana: HAPPY BIRTHDAY mr_F :banana: :banana:

Grendel
09-21-2004, 04:25 PM
Just for Info...

Downloading filenames with spaces,
can results in corrupted .DLCount-files.

mr_F_2
09-21-2004, 11:48 PM
Originally posted by Grendel
Just for Info...

Downloading filenames with spaces,
can results in corrupted .DLCount-files.

can result in, or does? my computer crashed and my source code is temporarily unavailable. but i'll fix it when i get the chance (soon)

Grendel
09-22-2004, 12:30 PM
normally .ioFTPD.DLCount file contains:

filename.extension<TAB>Bytes<TAB>DL-counter

Here's one example with same release:

.ioFTPD.DLCount after first DL (without spaces in filename):


01_-_track1.mp3 9828238 1
02_-_track2.mp3 9571305 1
03_-_track3.mp3 7675283 1
04_-_track4.mp3 9865820 1
05_-_track5.mp3 6333599 1
06_-_track6.mp3 14115302 1
07_-_track7.mp3 6568398 1
08_-_track8.mp3 13195592 1
09_-_track9.mp3 15916313 1
10_-_track10.mp3 6697641 1

and now .ioFTPD.DLCount after first DL (with spaces in filename):
this is what I got...

09 - track9.mp3 15916313 107 - track7.mp3 6568398 105 - track5.mp3 6333599 103 - track3.mp3 7675283 110 - track10.mp3 6697641 0
09 - track9.mp3 15916313 0
08 - track8.mp3 13195592 0
07 - track7.mp3 6568398 0
06 - track6.mp3 14115302 0
05 - track5.mp3 6333599 0
04 - track4.mp3 9865820 0
03 - track3.mp3 7675283 0
02 - track2.mp3 9571305 0
08 - track8.mp3 13195592 106 - track6.mp3 14115302 104 - track4.mp3 9865820 102 - track2.mp3 9571305 101 - track1.mp3 9828238 1
10 - track10.mp3 6697641 1

also it doen't show the msg

"226-Total of xx MB downloaded in x files."

in this case

wooolF[RM]
11-28-2004, 08:32 PM
hey mr_F :)

I took a look at one script of yours called ioDLcount. The idea is very good, kinda nifty feature :) I would like to use it (and actually allready tried it) but forced to not do so.

Why not? Well... I sort all of my sections/folders/releases by date (newest first), that way I can see latest releases at the top. And ioDLcount completely messes it up cause it saves data in the file inside of the release folder (thus updating data stamp of the release).

So... I was gonna ask you if there's any chances to redo proggie in some way (still thinking about speed which is main concept of ioFTPD) where it wont update date stamp of the release. Kinda tricky probably... I thought maybe it could be saved under /logs folder ... hmmm :)

Regards :)

mr_F_2
11-28-2004, 10:01 PM
i like it.

i forgot all about fixing the spaces bug so i'll do that right now and try getting your log path thingy underway. but i'm not sure how well it'll work because it's going to require one big ass file which is kind of slow...

i guess i could do a folder inside logs called ioDLcount that contains a DLcount file for each filename that has been accessed on FTP... because access times would be DRAMATICALLY and INSANELY improved then.

what do you think?

mr_F_2
11-29-2004, 01:10 AM
CHECK the script page biiitch

http://www.ioftpd.com/scripts/script.php?id=136

fixed some bugs, no log path thingy yet though i'll try that soon

changelog::

- fixed major filesizing bug in the getfilesize routine, filesizes were reported wrong sometimes
- fixed major filesizing bug in the listdir routine, filesizes were reported wrong sometimes
- fixed bug that made files with spaces in them not work
- re-stylized I/O routines ....
- added a prevention line of code to stop those damned directories getting listed in the DLcount files..


ALSO

UPDATE YOUR IOFTPD.INI, the SYNTAX CHANGED

wooolF[RM]
11-29-2004, 06:58 AM
Originally posted by mr_F
i guess i could do a folder inside logs called ioDLcount that contains a DLcount file for each filename that has been accessed on FTP... because access times would be DRAMATICALLY and INSANELY improved then.

what do you think?

Yeh, 1 DLcount for each file sounds most clever and fastest imho :) Go for it! :D Good luck ;)

Regards

mr_F_2
11-29-2004, 11:30 PM
I released 2 MORE versions

both are of source 1.2 ... i used getfilesize routine to calculate all filesizes in versions 1.0 and 1.1... WELL that's a big mistake, and you'll see why when your FTP times out while it is calculating filesizes for the first time. Now i grab the filesizes directly from windows reporting the filesize (which I should have done in the first place but I'm stupid)...

So VERSION 1.2 fixes this huge error by getting rid of this routine all together. If you are running anything but V1.2 or V1.2W you should UPDATE NOW

it's about ... well, approximately ONE BILLION times faster and the timeout issue is gone

the SECOND new version out is 1.2W aka the WooolF[RM] version.

It dumps the files to folder ..\logs\ioDLcount_files
You gotta create this folder before it will work, but that's in the readme.txt
YES I could have made ioDLcount make this directory if it didn't exist but WHO wants to check for that shit when it coudl be a nanosecond faster???? :D

There is also another app included in the 1.2W version that is called when you delete a folder to delete the associated DLcount file in the DLcount store.

the ioDLcount_files store in version 1.2 works in manner like this:

Some.Release-GRP would create:
..\logs\ioDLcount_files\Some.Release-GRP
with data in it about how many times each file has been downloaded and the filesize of that file.

if the release is multicds or has subs or something it will look like this:
..\logs\ioDLcount_files\Some.Release-GRP-CD1
..\logs\ioDLcount_files\Some.Release-GRP-CD2
..\logs\ioDLcount_files\Some.Release-GRP-SUBS
..\logs\ioDLcount_files\Some.Release-GRP

so basically, a file for each directory.

hope you like it.

as always, full C source is included in the zipfile so you can peek at the code if you're curious or make sure it's not doing bad stuff if you're just paranoid ... or you can customize or help me improve it.

~~~ mr_F

mr_F_2
11-30-2004, 01:21 AM
if i told those 5 users who got version 1.2 (normal and version W) already, that if they are having a reporting problem
(IE: reports that 0 bytes have been downloaded no matter what...) i wonder if it would bother them that i admit to being an idiot?

... well if they DO have these problems... just re-download the files...
everything is fine... i'm sorry
I'm just tired of studying for exams and working on this project killed my brain more

wooolF[RM]
11-30-2004, 05:38 AM
Originally posted by mr_F
it's about ... well, approximately ONE BILLION times faster and the timeout issue is gonew00t w00t :D Go speedy go!

Originally posted by mr_F
the SECOND new version out is 1.2W aka the WooolF[RM] version.
...
hope you like it.Awww, I feel special :D :D :D Thanks a lot dude! And i'm more then sure I'll love it (that is if it works ;)).

My Best Regards :) Gotta give it a try :D

mr_F_2
12-10-2004, 01:41 PM
i made another thing
somebody can have it if they want it.
it doesn't deserve it's own script page, it will go in the next version of ioDLcount:

site dlcount
200-Interpol-Antics-Advance-(read_nfo)-2004-JUST has served ...
200-8.72 KB in 1 transfers of '00-interpol-antics-advance-2004-just.nfo' (8.72 KB)
200-
200-This directory has served 8.72 KB in 1 files
200 Command successful.


site dlcount
200-Constantines - Shine a Light has served ...
200-482.00 bytes in 1 transfers of '00-constantines_-_shine_a_light.m3u' (482.00 bytes)
200-2.75 MB in 1 transfers of 'constantines - 01 - national hum.mp3' (2.75 MB)
200-4.62 MB in 1 transfers of 'constantines - 02 - shine a light.mp3' (4.62 MB)
200-6.10 MB in 1 transfers of 'constantines - 03 - nighttime, anytime, it's alright.mp3' (6.10 MB)
200-3.82 MB in 1 transfers of 'constantines - 04 - insectivora.mp3' (3.82 MB)
200-3.72 MB in 1 transfers of 'constantines - 05 - young lions.mp3' (3.72 MB)
200-4.80 MB in 1 transfers of 'constantines - 06 - goodby baby and amen.mp3' (4.80 MB)
200-4.45 MB in 1 transfers of 'constantines - 07 - on to you.mp3' (4.45 MB)
200-3.50 MB in 1 transfers of 'constantines - 08 - poison.mp3' (3.50 MB)
200-2.66 MB in 1 transfers of 'constantines - 09 - scoundrel babes.mp3' (2.66 MB)
200-3.13 MB in 1 transfers of 'constantines - 10 - tiger and crane.mp3' (3.13 MB)
200-5.74 MB in 1 transfers of 'constantines - 11 - tank commander.mp3' (5.74 MB)
200-6.94 MB in 2 transfers of 'constantines - 12 - sub domestic.mp3' (3.47 MB)
200-
200-This directory has served 48.76 MB in 13 files
200 Command successful.


SETUP:

add to the site commands section of ioFTPD.ini ::

dlcount = EXEC ..\scripts\ioDLcount_viewer.exe

and give it permissions however you want (i gave mine::)
dlcount = * !A


you gotta exec 'site dlcount' from the dir you want to see the dlcount in

PEACE + MERRY XMAS

NOTE: ATTACHED VERSION (if mods approve it) ONLY WORKS WITH VERSION 1.2W of ioDLcount. PM me if you want a regular 1.2 version of this script. i gotta go study right now though :D

if script doesn't get attached/approved by mods then PM me and i'll put it somewhere else

wooolF[RM]
12-19-2004, 06:04 PM
looks like a lil nifty feature :D
*looking forward for a new version* :)

Best regards

thunk
12-20-2004, 03:59 PM
can you make .ioFTPD.DLcount files hidden please?

mr_F_2
12-20-2004, 04:47 PM
yeah i will make them hidden in the next version. i'll try post a minor version update around december 27th or so, or shortly into the new year.

mr_F_2
01-02-2005, 02:57 AM
New version, 1.3 is out. I only have released version 1.3W so far. I'm pondering not releasing 1.3 of the normal version (the version that writes to .ioFTPD.ioDLcount files). I see this method as more logical. If you want the normal version, please post here and i'll compile it. for now I think this should be fine.

~mr_F

CHANGELOG

ADDED: in normal version (writes .ioFTPD.ioDLcount files), those files are now marked as hidden
CHANGED: only add file to DLcount store if it's been downloaded, fixes problems with filesizes being incorrect (ie: user is uploading a file while another user finishes dling a different file. ioDLcount sees the file being uploaded, gets its current size and puts it in the ioDLcount store... this is bad, it will report this size even when the file has increased in size.

CHANGED: now ioDLcount doesn't log 0 byte files, for the reason of a 0-byte file not using any BW, sending no bytes, and it
writes an unecessary line to the log
CHANGED: modified a thingy, now ioDLcount can show proper units for total bytes downloaded vs filesize:
1.05 GB in 300 transfers of 'constantines - 12 - sub domestic.mp3' (3.47 MB)

get it here: http://www.ioftpd.com/scripts/script.php?id=136

mr_F_2
01-03-2005, 01:45 AM
my apologies.... i boinked something up and now it reports all files as the size of the first file uploaded. i'm going to fix it but don't have time right now (as in, not this minute, but hopefully tomorrow).

sorry to those 30 people who downloaded the release. I'm failure if it helps ease your mind :P

mr_F_2
01-10-2005, 05:57 PM
sorry... i ****ed something up, had no time to fix it ... but finally i did... so here's the next verison...

*sighs*

Jojje
01-10-2005, 07:30 PM
A small question regarding the environment variables...
I just noticed that I will have all this variables in my ioftpd.env if I install this script.

REALPATH=%[environment(PATH)]
PATH=%[environment(PATH)]
PATH=%[$path]

Can this be a problem? Or is it OK?

mr_F_2
01-10-2005, 07:33 PM
Originally posted by Jojje
A small question regarding the environment variables...
I just noticed that I will have all this variables in my ioftpd.env if I install this script.

REALPATH=%[environment(PATH)]
PATH=%[environment(PATH)]
PATH=%[$path]

Can this be a problem? Or is it OK?

you can't define a variable twice man... i recommend deleting PATH=%[environment(PATH)] line, as far as i know it's the equivalent as the PATH=%[$path] line

Jojje
01-10-2005, 07:39 PM
Oki m8... Thx for the fast response... + the help...
:D

neoxed
01-10-2005, 07:48 PM
Originally posted by mr_F
i recommend deleting PATH=%[environment(PATH)] line, as far as i know it's the equivalent as the PATH=%[$path] line
%[environment(PATH)] is the system PATH environment variable (type 'SET PATH' in a command prompt). Some applications require the PATH environment variable to be similar to the system one. However, %[$path] is the user's current working directory.

The ioFTPD environment variables were changed a while back.
http://www.ioftpd.com/board/showthread.php?s=&threadid=2356

mr_F_2
01-10-2005, 07:50 PM
i will update accordingly