mIRC Home    About    Download    Register    News    Help

Print Thread
Detect new file or folder #267431 04/07/20 03:19 PM
Joined: Nov 2003
Posts: 82
C
colt45 Offline OP
Babel fish
OP Offline
Babel fish
C
Joined: Nov 2003
Posts: 82
Hi, I'm hoping to write something that alert me for any new files/folders uploaded by someone onto my dropbox.

I plan to run this timer every 5 mins on mIRC startup

Code
alias FDD {
var %FDpath C:\Users\colt\Dropbox
  echo @NEW New Directory(s) Detected : $finddir(%FDpath,*.*,0,0,echo $1-)
  echo @NEW New File(s) Detected : $findfile(%FDpath,*.*,0,0,echo $1-)
}
The result isn't how I was hoping for, all I see the output was
Code
C:\Users\colt\Dropbox\Test
C:\Users\colt\Dropbox\test1.txt
C:\Users\colt\Dropbox\test2.txt
C:\Users\colt\Dropbox\test3.txt
but what I see in @NEW
Code
New Directory(s) Detected : 1
New File(s) Detected : 3
How can I get this to display them into @NEW window? So that it would show like this ...
Code
New Directory Detected : C:\Users\colt\Dropbox\Test
New File(s) Detected : C:\Users\colt\Dropbox\test1.txt
New File(s) Detected : C:\Users\colt\Dropbox\test2.txt
New File(s) Detected : C:\Users\colt\Dropbox\test3.txt


Hope someone can help me,

Thanks

Re: Detect new file or folder [Re: colt45] #267433 04/07/20 05:07 PM
Joined: Oct 2005
Posts: 34
S
SLiprockS Offline
Ameglian cow
Offline
Ameglian cow
S
Joined: Oct 2005
Posts: 34
Hi, you can try this out which may serve your purpose

Quote
alias FDD {
var %FDpath C:\Users\colt\Dropbox
/window @NEW | echo @NEW New Directory(s) Detected : $finddir(%FDpath,*.*,0,)
/window @NEW | echo @NEW New File(s) Detected : $findfile(%FDpath,*,0,1)
}


Thanks

Re: Detect new file or folder [Re: SLiprockS] #267435 04/07/20 06:27 PM
Joined: Jan 2004
Posts: 1,407
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,407
You've got 2 echoes going on, you're sending the count of matching folders to @new but the echo of the individual matches are going to the status window. If you want both to go to @new, then you need to send both echoes there. If you only want the matches going there, then do something like

//noop $finddir(%fdpath,*,0,1,echo @NEW New Directory(s) Detected : $1-)

Note that the depth of 0 you used behaves like depth of 1, so you're not seeing subdirs unless you either change depth to something big like 99 or just drop that 4th parm. Also note that if you're trying to copy/move folders or filenames someone creates having doublespaces would require special handling, such as addressing them using $shortfn.

Re: Detect new file or folder [Re: SLiprockS] #267443 05/07/20 12:09 PM
Joined: Nov 2003
Posts: 82
C
colt45 Offline OP
Babel fish
OP Offline
Babel fish
C
Joined: Nov 2003
Posts: 82
Originally Posted by SLiprockS
Hi, you can try this out which may serve your purpose

Quote
alias FDD {
var %FDpath C:\Users\colt\Dropbox
/window @NEW | echo @NEW New Directory(s) Detected : $finddir(%FDpath,*.*,0,)
/window @NEW | echo @NEW New File(s) Detected : $findfile(%FDpath,*,0,1)
}


Thanks


Thanks for getting back to me, however - it's not how I want to see .. I see this when I ran that.
Code
New Directory(s) Detected : 1
New File(s) Detected : 3

and nothing else, I just want to display the new filename and new directory .. not numbers smile
Preferably want to announce into a channel where I and my other friend can view of any new items coming in.

Re: Detect new file or folder [Re: maroon] #267444 05/07/20 12:13 PM
Joined: Nov 2003
Posts: 82
C
colt45 Offline OP
Babel fish
OP Offline
Babel fish
C
Joined: Nov 2003
Posts: 82
Originally Posted by maroon
You've got 2 echoes going on, you're sending the count of matching folders to @new but the echo of the individual matches are going to the status window. If you want both to go to @new, then you need to send both echoes there. If you only want the matches going there, then do something like

//noop $finddir(%fdpath,*,0,1,echo @NEW New Directory(s) Detected : $1-)

Note that the depth of 0 you used behaves like depth of 1, so you're not seeing subdirs unless you either change depth to something big like 99 or just drop that 4th parm. Also note that if you're trying to copy/move folders or filenames someone creates having doublespaces would require special handling, such as addressing them using $shortfn.


That's the one! laugh
Works, now time for me to improvise!
Thanks smile