FSwatcher - FileSizewatcher

english FSwatcher.lzx FSwatcher.lha Readme History
What for is it?
  If you download a file with a program which doesn't have a transfer-
  window showing the current filesize, bps, time togo etc. you should
  try FSwatcher.


Detailed description:
---------------------
It opens a small window where you have to specify the filename
and the filesize.
Then press "Start" and the window changes to the gauge, where
the current size in bytes, the bytes transfered per second, the
time since the file was created and the approx. time it takes
to transfer the whole file.
Under the gauge is also a percentage scale.

You can also drop a file from a workbench window or dopus lister
anywhere into the window to specify the filename.
If the comment of the filename is set to a number, it will be used
as the total filesize (in bytes).
Also if you press the "Start!" button without specifying a filesize
(-> the "Size:" gadgets contents is "0"), the filesize is read from
the comment of the file.

Or you specify the filename and the filesize (if the filename didn't
have its comment set to the filesize) at startup.

The values are updated every 3 seconds.

When the transfer it finished a requester pops up, saying its
finished;-) You can disable the requester by setting the shell
argument AUTOEXIT to ON or YES at startup, the program then quits
automatically after a download is finished.

New in v1.3: (have a look at the .history file for a complete overview)
============
Since v1.3, you can set the environment variable "FSwatcher" to your
default args! Just like as you have typed them on the commandline!
For example: SetEnv SAVE FSwatcher "BPSBar ON"
To implement this I had to change the AUTOEXIT/S arg to a /T arg.
This means you have to put a "ON" or "YES" after the arg to activate
it and a "OFF" or "NO" to deactivate an argument!

If you have used programs which used the AUTOEXIT arg, you can patch
them by replacing "AUTOEXIT" with "EXIT YES" or wait for an update
of the program;-)


New in v1.4: (have a look at the .history file for a complete overview)
============
There is now a button called "!" at the right of the filesize gauge.
If you press this button a script (defaults to s:FSwatcher.bat) is
executed asynchronicly (sp?) with the currently used filename as an
argument.
The included script (s/FSwatcher.bat) supports playing of mp3 songs
(you have to have "mpega" in your search path) and mpg movies via
"frogger" (you have to have it in your search path, or edit the script).
This script makes use of the program MatchPattern which I have
included in this archive (c/MatchPattern).

New in v1.5: (have a look at the .history file for a complete overview)
============
For Shell v45.6+ users I added support for its "magic stackcookie"
feature, the stacksize will be automatically set to 16K, if FSwatcher
is started from a shell.
If its not working for you, you should set the stacksize to at least
8KB or 12KB, 4KB is definitely not enough!
There are now 2 executables in the archive, one is called "FSwatcher"
and one "FSwatcher_NoGuru". The first is about 3K smaller, but has some
checks disabled and may (but shouldn't) cause crashes if an internal
error occurs. The second (like the previous versions) has these checks
enabled and should show an error msgs if an internal error occurs.


Hint:
  You can click on the gauge to get back to the settings page of the
  window.

Hint #2:
  The values of the "Name" and "Size" Gadgets are saved after quiting the
  programm in the env and envarc.


Usage: 
       Name=FileName,Size=FileSize/N,TimeOut/N,Delay=UpdateDelay/N,
       Com=Command,ComCon=CommandConsole,
       AS=AutoSize/T,BPSBar/T,AUTOEXIT/T,QUIET/T

FileName, FileSize and AutoExit described above, now lets explain the
other:

  TimeOut/N: New in v1.3
     If a transfer is stalled (-> the "---" display) AND AUTOEXIT/T is
     set to ON, the window will close after 'TimeOut' seconds.
     Defaults to 10. You can use values from 0 to 30. 0 means, no timeout.

  Name=FileName:
     see above
     
  Size=FileSize/N:
     see above

  TimeOut/N:
     If a transfer is stalled (-> the "---" display) AND AUTOEXIT/T is
     used, the window will close after 'TimeOut' seconds.
     Defaults to 10. You can use values from 0 to 30. 0 means, no timeout.

  Delay=UpdateDelay/N: New in v1.3
     Update the display every x seconds. Defaults to 2.
     You can use values from 1 to 10.

  Com=Command: New in v1.4
     This command will be executed if you press the "!" button!
     You can use it f.e. to play the currently downloading mp3 song!
     Default is "s:FSwatcher.bat".
     The 's' and/or 'x' bit have to be set, if the command is
     a shell-script!
     If you set it to "" (en empty string), not "!" button will
     be created! (new in v1.5)

  ComCon=CommandConsole: New in v1.4
     This is used to specify a console window where the output of
     the command is send to.
     Default: CON:210/400/500/120/FSwatcher action command/CLOSE
     If you don't want a window, use ComCon = NIL:.

  AS=AutoSize/T: New in v1.5
     If used (AutoSize = YES), the current size, the filesize and
     the bps are shown in B (=Bytes), if the size is < 1024 Bytes,
     in KB, if the size is >= 1024 Bytes and in MB, if the size
     is >= 1048576 Bytes!

  BPSBar/T: New in v1.3
     Should a small gauge showing the current bps relative to the
     max bps be displayed?

  AUTOEXIT/T
     If means no finished-requester at the end and quit the program
     after the is download finished.
     AUTOEXIT YES

  QUIET/T [suggested by jah] New in v1.3
     Should ALL error requesters be suppressed?
     Well the "Dos.ReadArgs() failed!" isn't suppressed;-)
~17KB or ~20KB, v1.5 vom 26.05.02