1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to? Using FOLDERMONITOR 1 event causes multiple trigger(ing)s

Discussion in 'Support' started by tmpease, Nov 17, 2012.

  1. tmpease

    Joined:
    Jan 22, 2009
    Messages:
    10
    Likes Received:
    0
    ========
    ATTEMPT #1

    When I try something very similar to the example in the help:
    foldermonitor c:\tcc\inbox created modified forever copy "%%_folderfile1" "c:\tcc\outbox\"​

    then execute (the event)
    [C:\tcc\inbox] copy ..\foo bar /Q​

    The trigger(s) copy(s) it 3 times:
    C:\TCC\inbox\bar => C:\tcc\outbox\bar
    1 file copied
    C:\TCC\inbox\bar => C:\tcc\outbox\bar
    1 file copied
    C:\TCC\inbox\bar => C:\tcc\outbox\bar
    1 file copied

    ========
    ATTEMPT #2

    To see which trigger types were doing this, I tried
    foldermonitor /c​
    foldermonitor c:\tcc\inbox created modified forever copy "%%_folderfile1" "c:\tcc\outbox\%%_folderaction" ​

    then execute (the event)
    [C:\tcc\inbox] copy ..\foo bar /Q​

    1 CREATED and 2 MODIFIEDs triggers fire:
    C:\TCC\inbox\foo => C:\tcc\outbox\CREATED
    1 file copied
    C:\TCC\inbox\foo => C:\tcc\outbox\MODIFIED
    1 file copied
    C:\TCC\inbox\foo => C:\tcc\outbox\MODIFIED
    1 file copied ​

    And BTW: the prompt doesn't come up.

    ========
    ATTEMPT #3
    When I try this:
    foldermonitor /c ​
    foldermonitor c:\tcc\inbox CREATED forever copy "%%_folderfile1" "c:\tcc\outbox\%%_folderaction" ​

    then execute (the event)
    [C:\tcc\inbox] copy ..\foo bar /Q​

    3 triggers still fire;
    C:\TCC\inbox\bar => C:\tcc\outbox\CREATED
    1 file copied
    TCC: (Sys) The system cannot find the file specified.
    ""
    0 files copied
    TCC: (Sys) The system cannot find the file specified.
    ""
    0 files copied ​

    And BTW: the prompt doesn't come up.

    ===
    Even when DELeting
    [c:\tcc\inbox]del bar /Q​

    1 trigger fires, apparently after deletion
    TCC: (Sys)
    The system cannot find the file specified.
    ""
    0 files copied ​

    ===
    Even When RENaming /Q
    [c:\tcc\inbox]ren bar fooey​

    3 triggers fire, apparently using the old name
    TCC: (Sys) The system cannot find the file specified.
    ""
    0 files copied
    TCC: (Sys) The system cannot find the file specified.
    ""
    0 files copied
    TCC: (Sys) The system cannot find the file specified.
    ""
    0 files copied ​


    ------------------------------------------------------------------
    Any help would be greatly appreciated.
    --Tim
     
  2. Joe Caverly

    Joined:
    Aug 28, 2009
    Messages:
    638
    Likes Received:
    6
    What version of TCMD, and what OS and version?

    Joe
     
  3. tmpease

    Joined:
    Jan 22, 2009
    Messages:
    10
    Likes Received:
    0
    Most recent version of TCMD. Most up to date Win XP. Do you need version numbers?
     
  4. Joe Caverly

    Joined:
    Aug 28, 2009
    Messages:
    638
    Likes Received:
    6
    Hi,
    When I do;

    Code:
    foldermonitor c:\utils created modified forever copy "%%_folderfile1" "c:\utils\outbox"
    then open mybu.btm in NotePad++, make a change, then save mybu.btm, I get;

    Code:
    C:\utils\mybu.btm => C:\utils\outbox\mybu.btm
         1 file copied
    C:\utils\outbox\mybu.btm => C:\utils\outbox\mybu.btm
    TCC: Can't COPY or MOVE file to itself "C:\utils\outbox\mybu.btm"
         0 files copied       1 failed
    C:\utils\mybu.btm => C:\utils\outbox\mybu.btm
         1 file copied
    I also have to press ENTER to get the prompt back.

    I also tried this on;

    Code:
    TCC  12.11.76   Windows XP [Version 5.1.2600]
    TCC Build 76   Windows XP Build 2600  Service Pack 3
    Same results. As the example from the help is;

    Code:
    For example, to monitor your [B][I]d:\results[/I][/B] directory and copy any new or modified files to a web page:
     
    foldermonitor d:\results created modified forever copy "%%_folderfile1" "http://mycompany.com/results/"
    Either the example in the help is not correct, something is wrong with the command, or I am missing something simple.

    Joe
     
  5. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,784
    Likes Received:
    29
    1. I'm not surprised that the prompt is not re-issued after output is generated by a FOLDERMONITOR command. A thread other than TCC's main thread is doing the monitoring and the main thread (issuing prompts, accepting input, et c.) is not aware that there has been output.

    2. I don't know if it's by design, but _FOLDERFILE1 is not fully-qualified; it's just a file name. So whether or not it's found will depend on TCC's current directory.
     
  6. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,726
    Likes Received:
    80
    WAD. Windows only returns the filename; if you want the path you'll have to add it yourself.
     
  7. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,726
    Likes Received:
    80
    WAD -- Windows is returning three events. If you don't want all the events, you need to filter them.

    See above. And the prompt did come up, but it was overwritten by the asynchronous output from COPY in the monitoring thread.

    The Windows behavior is to return multiple events on most file operations. It's up to the user to decide which ones they want -- there's no way for TCC to automagically determine which one is most important to you.
     
  8. JohnQSmith

    Joined:
    Jan 19, 2011
    Messages:
    560
    Likes Received:
    8
    What?!? I thought you had perfected that DWIM parser! ;)
     
  9. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,726
    Likes Received:
    80
    It's an optional add-on. Just email me your credit card info (better make that *all* of your credit cards). :blackalien:
     
    TEA-Time likes this.

Share This Page