FILESYS MODULE
TCL COMMANDS:
setpwd <idx> <dir>
changes the directory of a file system user, in exactly the same way as a 'cd' command would (ie, the directory can be specified relative or absolute)
returns: nothing

getpwd <idx>
returns: the current directory of a file system user

getfiles <dir>
returns: list of files in the directory given; the directory is relative to dcc-path

getdirs <dir>
returns: list of subdirectories in the directory given; the directory is relative to dcc-path

filesend <idx> <filename> [ircnick]
like dccsend, except it operates for a current filesystem user, and the filename is assumed to be a relative path from that user's current directory
returns: "0" on failure; "1" on success (either an immediate send or a queued send)

setdesc <dir> <file> <desc>
sets the description for a file in a file system directory; the directory is relative to the dcc-path
returns: nothing

getdesc <dir> <file>
returns: the description for a file in the file system, if one exists

setowner <dir> <file> <handle>
changes the owner for a file in the file system; the directory is relative to the dcc-path
returns: nothing

getowner <dir> <file>
returns: the owner of a file in the file system

setlink <dir> <file> <link>
creates or changes a linked file (a file that actually exists on another bot); the directory is relative to dcc-path returns: nothing

getlink <dir> <file>
returns: the link for a linked file, if it exists

getfileq <handle>
returns: list of files queued by someone; each item in the list will be a sublist with two elements: nickname the file is being sent to, and the filename

setuploads <handle> <#uploads> <size-in-k>
sets a user's statistics on the number of files uploaded and the total kilobytes uploaded
returns: nothing

getuploads <handle>
returns: list containing upload statistics for a user: the first element is the number of files uploaded; the second element is the total kilobytes uploaded

setdnloads <handle> <#dnloads> <size-in-k>
like setuploads, but sets the download statistics
returns: nothing

getdnloads <handle>
returns: list containing download statistics, in the same format as getuploads

mkdir <directory> [required-flags]
creates a directory in the files system, only users with the required flags may access
returns:
0 on success
1 on can't create directory
2 on directory exists but is not a directory

rmdir <directory>
removes a directory from the file system.
returns: 0 on success, 1 on failure

mv <file> <destination>
moves the file from it's source to the given destination, file can also be a mask, eg /incoming/* provided the destination is a directory
returns: number of files copied on success or negative numbers to indicate errors: -1 = invalid source file, -2 = invalid dest -3 = you're trying to copy onto itself (duh!) -4 = no matches found

cp <file> <destination>
exactly the same as mv except it leaves the original file there as well
returns: same as mv

getflags <dir>
returns: the flags required to access this directory

setflags <dir> [flags]
sets the flags required to access the directory
returns: 0 on success, -1 on failure


TCL VARIABLES:
files-path
where the filesys is stored

incoming-path
where to upload files if upload-to-cd = 0

filedb-path
where to store filedb's if they can't be stored in the directories themselves

max-filesize
maximum file transfer size in kbytes

max-file-users
maximum number of users allowed in the file area

upload-to-pwd
allow users to upload to their current directory?


USER ENTRIES:
Two user entries relating to filesytem transfers are also added, FSTAT and DCCDIR to TCL users (USERENTRY_FSTAT and USERENTRY_DCCDIR to C programmers, see filesys.h for the struct for fstat, dccdir is a normal unshared string). The values can be set/read using get/setuser
getuser <handle> FSTAT [u/d]
returns: the users FSTAT entry, if u or d is specified, only the uploads or downloads are returned, otherwise uploads and downloads are returned, all are in the form 'files kbytes'

setuser <handle> FSTAT <u/d> [files [kbytes]]
sets a users FSTAT entry (u = uploads, d = downloads), settings default to 0.

getuser <handle> DCCDIR
returns: the user's currently saved dcc directory

setuser <handle> DCCDIR <dir>
sets a new value for a users dcc directory


BINDING(S) TABLE(S):
A binding table is also provided for the file system area commands: (Note: everything is passed through the FILT binding table first)
bind fil <flags> <command> <proc>
calls TCL: (tcl callback provided)
procname <handle> <idx> <args>
return: 1 to make the file get logged as:
#handle# files: command
calls C:
args[1] = & (int) idx;
args[2] = char * args;
Used for commands from a file area user. the command is the first word and everything else is the args string. the idx is valid until the user disconnects.

(c) 1997 Robey Pointer
(c) 1998 Eggdrop Development Team