Utility to pop up a window when a file exists? - OS2

This is a discussion on Utility to pop up a window when a file exists? - OS2 ; I have an "uploads" dir on my server. It isn't used much, and I don't manually check it unless someone emails me to let me know that they uploaded something. I'd like a utility checks that dir every minute or ...

+ Reply to Thread
Results 1 to 15 of 15

Thread: Utility to pop up a window when a file exists?

  1. Utility to pop up a window when a file exists?

    I have an "uploads" dir on my server. It isn't used much, and I don't
    manually check it unless someone emails me to let me know that they
    uploaded something.

    I'd like a utility checks that dir every minute or ten minutes or hour,
    and when it finds a file in that dir (any file), it pops up a window to
    the foreground to let me know.

    In particular, I do NOT want the utility to make any noise.

    This sounds like a REXX script to me. Is there a canned script that
    does something like this?

    Regards,
    Al S.

  2. Re: Utility to pop up a window when a file exists?

    On 23 Set, 07:12, "Al Savage" wrote:
    > I have an "uploads" dir on my server. *It isn't used much, and I don't
    > manually check it unless someone emails me to let me know that they
    > uploaded something.
    >
    > I'd like a utility checks that dir every minute or ten minutes or hour,
    > and when it finds a file in that dir (any file), it pops up a window to
    > the foreground to let me know.
    >
    > In particular, I do NOT want the utility to make any noise.
    >
    > This sounds like a REXX script to me. *Is there a canned script that
    > does something like this?


    I don't remember anything similar, but it should be done like the
    timed mail check found in any mail client (which I don't use).

    It should be fairly easy to do with REXX + VREXX/2, just opening a
    dialog o message box (better a complete window with details of all the
    uploaded packages, imho).

    If nobody finds out something, let me know at mentore dot siesto at
    alice dot it, I might try and build up something (in my little spare
    time).

    Mentore

  3. Re: Utility to pop up a window when a file exists? - dircheck.cmd [1/1]

    On Tue, 23 Sep 2008 05:12:19 UTC, "Al Savage" wrote:

    > I'd like a utility checks that dir every minute or ten minutes or hour,
    > and when it finds a file in that dir (any file), it pops up a window to
    > the foreground to let me know.
    >
    > In particular, I do NOT want the utility to make any noise.
    >
    > This sounds like a REXX script to me. Is there a canned script that
    > does something like this?


    Just wrapped this up.
    Change the CheckDir line to your needs.
    Start is as "PMREXX dircheck.cmd"


    --
    Allan.

    It is better to close your mouth, and look like a fool,
    than to open it, and remove all doubt.


  4. Re: Utility to pop up a window when a file exists?

    On Tue, 23 Sep 2008 05:12:19 UTC, "Al Savage" wrote:

    > I have an "uploads" dir on my server. It isn't used much, and I don't
    > manually check it unless someone emails me to let me know that they
    > uploaded something.
    >
    > I'd like a utility checks that dir every minute or ten minutes or hour,
    > and when it finds a file in that dir (any file), it pops up a window to
    > the foreground to let me know.
    >
    > In particular, I do NOT want the utility to make any noise.
    >
    > This sounds like a REXX script to me. Is there a canned script that
    > does something like this?


    Dunno, but it's really trivial. Just use SysFileTree, check stem.0 and
    use RxMessageBox!


  5. Re: Utility to pop up a window when a file exists?

    On 09/22/08 10:12 pm, Al Savage wrote:
    > I have an "uploads" dir on my server. It isn't used much, and I don't
    > manually check it unless someone emails me to let me know that they
    > uploaded something.
    >
    > I'd like a utility checks that dir every minute or ten minutes or hour,
    > and when it finds a file in that dir (any file), it pops up a window to
    > the foreground to let me know.
    >

    Sounds like a job for cron. Write a REXX script to do the check and
    popup; add it to the list of things for cron to do.
    There are number of cron clones on hobbes.

    --
    jmm (hyphen) list (at) sohnen-moe (dot) com
    (Remove .AXSPAMGN for email)

  6. Re: Utility to pop up a window when a file exists? - dircheck.cmd [1/1]

    In , on 09/23/2008
    at 02:16 PM, "Allan" said:

    Hi,

    >Just wrapped this up.
    >Change the CheckDir line to your needs.
    >Start is as "PMREXX dircheck.cmd"


    FWIW, you don't need to run this under pmrexx. I typically run these
    kinds of apps as

    start "dircheck" /min dircheck.cmd

    Steven

    --
    --------------------------------------------------------------------------------------------
    Steven Levine MR2/ICE 3.00.11.17 BETA #10183
    eCS/Warp/DIY/14.103a_W4 www.scoug.com irc.ca.webbnet.info #scoug (Wed 7pm PST)
    --------------------------------------------------------------------------------------------


  7. Re: Utility to pop up a window when a file exists? - dircheck.cmd [1/1]

    On Tue, 23 Sep 2008 21:47:41 UTC, Steven Levine wrote:

    > >Just wrapped this up.
    > >Change the CheckDir line to your needs.
    > >Start is as "PMREXX dircheck.cmd"

    >
    > FWIW, you don't need to run this under pmrexx. I typically run these
    > kinds of apps as
    >
    > start "dircheck" /min dircheck.cmd


    Naa, doesn't work ....

    RxMessageBox requires PMrexx or another PM app to start it.
    Sure, you can start it like that - but you will never get the popup,
    that was the whole idea about the util ;-)

    --
    Allan.

    It is better to close your mouth, and look like a fool,
    than to open it, and remove all doubt.

  8. Re: Utility to pop up a window when a file exists?

    On Tue, 23 Sep 2008 05:12:19 UTC, "Al Savage" wrote:

    > I have an "uploads" dir on my server. It isn't used much, and I don't
    > manually check it unless someone emails me to let me know that they
    > uploaded something.
    >
    > I'd like a utility checks that dir every minute or ten minutes or hour,
    > and when it finds a file in that dir (any file), it pops up a window to
    > the foreground to let me know.
    >
    > In particular, I do NOT want the utility to make any noise.
    >
    > This sounds like a REXX script to me. Is there a canned script that
    > does something like this?


    This is my solution:

    ------------------------------------------------
    /*
    * Check a directory and display message
    *
    */

    call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
    call SysLoadFuncs

    dir = 'f:\temp'
    message = 'File(s) have changed'
    interval = 10 /* seconds */
    n = 0

    do forever
    call SysFileTree dir'\*','f.','F'
    if f.0 \= n then do
    call RxMessageBox message,'Information','OK','INFORMATION'
    n = f.0
    end
    Call SysSleep interval
    end
    ----------------------------------------



  9. Re: Utility to pop up a window when a file exists?

    On 23 Sep 2008 23:31:18 GMT, Bob Eager wrote:

    > do forever
    > call SysFileTree dir'\*','f.','F'
    > if f.0 \= n then do
    > call RxMessageBox message,'Information','OK','INFORMATION'
    > n = f.0
    > end
    > Call SysSleep interval
    > end


    A better way would be:

    do forever
    call SysFileTree dir'\*','f.','F'
    if f.0 > n then
    call RxMessageBox message,'Information','OK','INFORMATION'
    n = f.0
    Call SysSleep interval
    end

    as then you don't get nagged when you clear out the directory.

  10. Re: Utility to pop up a window when a file exists? - dircheck.cmd [1/1]

    In , on 09/24/2008
    at 12:58 AM, "Allan" said:

    >Naa, doesn't work ....


    Sure it does, under 4os2. I tested under cmd.exe too, but messed up the
    test environment so the results fooled me into thinking that cmd was
    capable of this as well.

    >RxMessageBox requires PMrexx or another PM app to start it.


    4os2 is not a PM app, but it does enough interfacing to PM to allow
    RxMessageBox to work without requiring the pmrexx front-end.

    Steven

    --
    --------------------------------------------------------------------------------------------
    Steven Levine MR2/ICE 3.00.11.17 BETA #10183
    eCS/Warp/DIY/14.103a_W4 www.scoug.com irc.ca.webbnet.info #scoug (Wed 7pm PST)
    --------------------------------------------------------------------------------------------


  11. Re: Utility to pop up a window when a file exists? - dircheck.cmd [1/1]

    On Wed, 24 Sep 2008 03:53:57 UTC, Steven Levine wrote:

    > >Naa, doesn't work ....

    >
    > Sure it does, under 4os2.


    Oh, I don't use that, and I don't think many endusers do..

    > >RxMessageBox requires PMrexx or another PM app to start it.

    >
    > 4os2 is not a PM app, but it does enough interfacing to PM to allow
    > RxMessageBox to work without requiring the pmrexx front-end.


    Well, interesting to know.
    The same can be archieved with IBM cmd.exe, like this:

    start /PM cmd.exe /C dircheck.cmd

    ..but... isn't it just easier to use PMrexx ? :-)

    --
    Allan.

    It is better to close your mouth, and look like a fool,
    than to open it, and remove all doubt.

  12. Re: Utility to pop up a window when a file exists? - dircheck.cmd[1/1]

    On 24 Set, 12:00, "Allan" wrote:
    > On Wed, 24 Sep 2008 03:53:57 UTC, Steven Levine wrote:
    > > >Naa, doesn't work ....

    >
    > > Sure it does, under 4os2.

    >
    > Oh, I don't use that, and I don't think many endusers do..
    >
    > > >RxMessageBox requires PMrexx or another PM app to start it.

    >
    > > 4os2 is not a PM app, but it does enough interfacing to PM to allow
    > > RxMessageBox to work without requiring the pmrexx front-end.

    >
    > Well, interesting to know.
    > The same can be archieved with IBM cmd.exe, like this:
    >
    > start /PM cmd.exe /C dircheck.cmd
    >
    > .but... isn't it just easier to use PMrexx ? :-)


    Linking RexxUtil will do the job. It's just enough to link
    RxMessageBox.

    Mentore

  13. Re: Utility to pop up a window when a file exists?

    On Wed, 24 Sep 2008 01:32:52 UTC, Paul Ratcliffe
    wrote:

    > On 23 Sep 2008 23:31:18 GMT, Bob Eager wrote:
    >
    > > do forever
    > > call SysFileTree dir'\*','f.','F'
    > > if f.0 \= n then do
    > > call RxMessageBox message,'Information','OK','INFORMATION'
    > > n = f.0
    > > end
    > > Call SysSleep interval
    > > end

    >
    > A better way would be:
    >
    > do forever
    > call SysFileTree dir'\*','f.','F'
    > if f.0 > n then
    > call RxMessageBox message,'Information','OK','INFORMATION'
    > n = f.0
    > Call SysSleep interval
    > end
    >
    > as then you don't get nagged when you clear out the directory.


    In fact, that's how I originally wrote it - but it wasn't clear which
    behaviour would be better. Lack of a full spec. here!


  14. Re: Utility to pop up a window when a file exists?

    Jim Moe wrote:
    > On 09/22/08 10:12 pm, Al Savage wrote:
    >
    >>I have an "uploads" dir on my server. It isn't used much, and I don't
    >>manually check it unless someone emails me to let me know that they
    >>uploaded something.
    >>
    >>I'd like a utility checks that dir every minute or ten minutes or hour,
    >>and when it finds a file in that dir (any file), it pops up a window to
    >>the foreground to let me know.

    >
    > Sounds like a job for cron. Write a REXX script to do the check and
    > popup; add it to the list of things for cron to do.
    > There are number of cron clones on hobbes.


    eCS users have a built-in Task Scheduler (if eCSClock is running) to do
    the job.

    --
    [Reverse the parts of the e-mail address to reply.]

  15. Re: Utility to pop up a window when a file exists?

    On Tue, 23 Sep 2008 05:12:19 UTC, "Al Savage" wrote:
    Thanks to Allan, Paul, and Bob. I appreciate your help. The code works
    well.

    Regards,
    Al S.

+ Reply to Thread