OnDirCreated is a simple tool that will add a small file in the parent of the dir that is just created. It can also remove a just created dir (with non raiden ftp servers) or just simply stop the creation of a dir (raiden only). The usefullness lies in the fact that you can stop dirs with words in there you do not want, like swedish, german, hpux, etc... and that you can stop a dupe dir being created. The program takes 2 parameters. Dir= This is the full path name of the created dir RaidenReply= This is specially for raiden, using this will activate the ask interface for this program. Normally under most servers it is not possible to stop the creation of a dir so a newly made dir is removed very quickly if it is a dupe or so. With the ASK interface it is possible to disallow a new dir without having to create the dir (good work from raiden!) You will have to place the typical ASK stuff in here for raiden. Example (this needs to be in your raiden .ftpd file onNewDir=ask://OnDirCreated.exe RaidenReply="C:\Program Files\RaidenFTPD\Output\ask-onNewDir.%@" Dir=%m For other ftp servers this RaidenReply= has no use. User= This is the name of the user that create the dir, if none is given DefaultUser will be taken Group= This is the name of the group of the user that creates the dir, if none is given default group will be taken Cmd= PRE|POST to determine what kind of command is being used, if the server supports it, it will be used (Raiden, serv-u with servuevent.dll, ioftpd) Call this program as follows (be aware you need quotes around it): OnDirCreated.exe Dir="full path of dir created" Setup examples: For using my tools the defaults will suffice, you wont need to set anything then except for setting up the ISODir= and the Remove=. The completion tag InDirCompleted=!-=[completed-%[PercentGood]%-%[FilesGood]-of-%[FilesExpected]-extra-%[FilesExtra]]=- has a PerCentGood variable in it which will be used to check whether a dir is completed. If so then the dupe dir creation can be blocked because of the 100% piece in this tag. Cookies: %[Environment_Variable] =Environment variable, specially usefull for ioFTPD. e.g. %[USER] %[ParentPath] =the full path of the parent dir %[DirPath] =the full real path of the directory %[DirName] =the name of the directory %[DupeDirName] =the dir where the dupe is %[DupeWord] =the word that forces the blocking %[DupeDateTime] =the date/time (if available) of the duped dir Partial example for Raiden using the default FTPServerTools.ini [Directories] ISODir=E:\ISO-Apps ISODir=E:\ISO-Games ISODir=F:\VCD Remove=*\*swedish* Remove=C:\FTP\[* Remove=*\*.beta* DupeCheckDir=E:\ISO-Apps|C:\FTPServer\Apps.lst|1|24 DupeCheckDir=E:\ISO-Games|C:\FTPServer\Games.lst|1|24 DupeCheckDir=E:\0day|C:\FTPServer\0day.lst|2|24 A DupeCheckDir line consists of: dir to dupecheck in|file to check dupe dirs in (only needed for dupelister)|depth to check|hours (only needed for dupelister) E:\0day|C:\FTPServer\0day.lst|2|24 If you skip the last two parts it works as well. E:\0day|C:\FTPServer\0day.lst If you also skip the second part then no file will be used to match E:\0day Leaving the |c:\FTPServer\0day.lst will force it to skip dir checking. Call with (in your raiden .ftpd file) (dont forget the quotes!). onNewDir=ask://OnDirCreated.exe ASK="C:\Program Files\RaidenFTPD\Output\ask-onNewDir.%@" Dir="%m" Partial BPFTP server /Serv-U example (just taking the default FTPServerTools.ini as example): [Directories] Remove=*\*swedish* Remove=C:\FTP\[* Remove=*\*.beta* ISODir=E:\ISO-Apps ISODir=E:\ISO-Games ISODir=F:\VCD DupeCheckDir=c:\FTP\0day DupeCheckFile=c:\FTPServer\0day.lst DupeCheckDir=c:\FTP\MP3 For bpftp call in the OnDirCreated event with (dont forget the quotes!): "C:\Program Files\G6 FTP Server\OnDirCreated.exe" DIR="%DIR" For Serv-U use in ServuDaemon.ini: [EXTERNAL] EventHookDLL1=c:\program files\Serv-U\ServuEvent.dll and in ServuEvent.ini: [Events] MakeDir=c:\program files\Serv-U\OnDirCreated.exe DIR="%1" About dupechecking there is the following to add: if a new dir gets created and it is not in any of the DupeCheckDir dirs then it is just ok and will be always accepted. If it is then it will be dupechecked within 2 levels of depth within that dir. So d:\0day\0901 d:\0day\0902 etc.. will be checked.. Suppose I have d:\0day\0901\release-cls and I want to make a dir d:\0day\0902\release-cls This will not be allowed since it is already in 0901. Unless the InParentInCompleted or the InDirCompleted is available or the dir it dupes with is not empty. Which means if d:\0day\0901\!release-cls-=[8-of-10-80%-completed]=- or any other file that matches the tag is there. In that situation the dupes are allowed. This means that dupes can only be created if two ppl create the dir in different days yet at about the same time. It will quite easily block completed dupes of the previous day. You can use this program seamlessly together with OnDirDeleted. Version history: 1.0.1 First version 1.0.2 Added Delete parameter 1.0.3 Changed the default from %s-=[no.files]=- to !%s-=[no.files]=- 1.0.4 Added dupe checking. 1.0.5 Changed the wildcard matching routine so that now *-NONFO and so is matched properly, previous version didnt match * in front 1.0.6 Added MultiLevelDirs taken from ftplogger 1.0.7 Somehow it was possible to still add a dupe dir, quite vague and hard to debug. I think its fixed now. 1.0.8 Recompiled to msvcrt.dll useage, smaller executable 1.0.9 Internal Raiden version 1.0.10 Be aware !!various tags in the ini file are renamed or replaced and added or removed. Raiden VFS type support with VFS= ,dir tag checking, reprogrammed so the tool can be used without using my other tools ASK= and Dir= commandline parameters now case-insensitive. 1.0.11 Bugfix on the VFS translation, not all VFS dirs were taken in consideration. Also if the virtual dir starts with \ then this \ is removed. 1.0.12 Changed various ini settings to another place, changed FTPLogger.ini to FTPServerTools.ini 1.0.13 Any occurance of / in the commandline of OnDirCreated.exe is changed to \ 1.0.14 Some issues with guildftp were resolved. Ending \ is being removed now from the DIR if it is there. 1.0.15 Improved on the Remove*= tag. It didnt check properly in the case of iso dirs. 1.0.16 Added ISODirHandleSubDirTags tag (default=TRUE) 1.0.17 Added ioFTPD support. 1.0.18 Added cookies for the other tags. InParentInComplete tag removed, now uses InDirCompleted tag. 1.0.19 Added %~p cookie recognition 1.0.20 TagType support 1.0.21 user environment variables supported in cookies (for use with ioftpd) 1.0.22 Fixed InDirComplete default, it was !-=[complete]=- instead of !-=[completed]=- 1.0.23 Added MessageFile handling. Added %f cookie support 1.0.24 Changed: The Remove1= Remove2=... Now compares with the complete path, not the dirname only. 1.0.25 Added: vfs:add and vfs:del for ioFTPD. 1.0.26 Changed: TagChmod= changed. no %[UID]:%[GID] can be used. 1.0.27 Fixed: Stupid mistake that cause !vfs:add not to work when the dir has a % sign in it 1.0.28 Removed: VFS= is removed, it didnt make much sense to me with the flexible remove tags Fixed: The error messages for the ask interface for raiden are fixed 1.0.29 Changed: Remove1= Remove2=.. to multiple Remove= lines Changed: IsoDir1= IsoDir2=.. to multiple IsoDir= lines Changed: DupeCheckDir1= DupeCheclDir2=.. to multiple DupeCheckDir= lines 1.0.30 Fixed: Not the full IsoDir, Remove and DupeCheckDir would be read in certain occasions of a big ini file 1.0.31 Changed: Multiple MsgCreated , ErrorMatch and ErrorDupe lines are possible now. Changed: ASK= now it named RaidenReply= 1.0.32 Changed: Message of dupe dir now doesnt show the full path anymore, only the relative path. 1.0.33 Fixed: Remove= didnt work for raidenFTPD., changed the to %t, %d, %s (almost like it was before). 1.0.34 Changed: TagType replaced by InParentTagType 1.0.35 Added: DupeCheckFile for dupechecking according to a file (use DupeList to create those files). 1.0.36 Added: %t tag now considered for deletion of the tag 1.0.37 Changed: the cookies are renamed to %[DirName] etc.. see FTPServerTools.ini, also some new tags are added. Fixed: DupeDir list wasnt checked correctly in all cases. 1.0.38 Added: Support for .raidenftpd.acl added Added: DefaultUserGroup= in the ini Changed: DefaultUserName= instead of DefaultUser= 1.0.39 Added: ErrorDupeList with default "DUPE:Dir %[DirName] blocked by external list, already created at %[DupeDateTime]" for blocking a dupe dir according to a list 1.0.40 Fixed: first dir from the dupelist could still be added as a dupe. Changed: ErrorDupeList now defaults to: DUPE:Dir %[DirName] blocked by %[DupeList], already created at:%[DupeDateTime] 1.0.41 Changed: InParentNoDiz default changed to !%[DirName]-=[no.filecount]=- 1.0.42 Changed: OnDirCreated is changed to a console program now. 1.0.43 Changed: If a dir is dupe or not allowed it returns dos error 82, The directory or file cannot be created. Changed: Serv-U specific return of -1 removed, standard reply should suffice. 1.0.44: Changed: InDirComplete cookie is no longer used for dupe dir detection, instead InDirCompleted is used where PercentGood is 100% Fixed: formatted cookies are now properly handled. Added: Environment variables are now properly translated if they are in the tags 1.0.45: Fixed: Bad default setting caused dupe dirs to pass instead of being blocked. 1.0.46: Changed: IgnoreFile= now also ignores dirs in OnDirCreated