AutoHotkey Community

It is currently May 25th, 2012, 5:31 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 97 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 7  Next
Author Message
 Post subject:
PostPosted: October 2nd, 2007, 10:48 am 
Offline

Joined: April 22nd, 2007, 6:33 pm
Posts: 1832
Quote:
@tic: Please allow me sometime.


sure thing boss! looking forward to this :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 10th, 2007, 1:10 pm 
Offline

Joined: April 22nd, 2007, 6:33 pm
Posts: 1832
No luck on this anyone? To have more than 1 folder specified


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 10th, 2007, 4:26 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
Skan wrote:
Please allow me sometime.

I don't really know if it'll work or not, however, I think it's worth trying.
The outcome will depend on the underlying mechanism of ReadDirectoryChangesW, I suppose.

If creating multiple monitoring is problematic, then I would rather use junction. Create an empty directory, then set up a different junction point as its subdirectory corresponding to each directory to be monitored. Finally set the directory itself as the monitored directory of ReadDirectoryChangesW.

At least one volume should be formated as NTFS.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 10th, 2007, 7:13 pm 
Offline

Joined: April 22nd, 2007, 6:33 pm
Posts: 1832
I would be fine with that idea Sean, but how then would you monitor 10 drives? as in A:\, B:\, C:\.....


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 10th, 2007, 11:21 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
tic wrote:
I would be fine with that idea Sean, but how then would you monitor 10 drives? as in A:\, B:\, C:\.....

In this case, you have to be careful in using a junction, to not enter an infinite loop. I would create 9 junctions of other drives in the chosen (NTFS) drive, then monitor that chosen drive.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 10th, 2007, 11:51 pm 
Offline

Joined: April 22nd, 2007, 6:33 pm
Posts: 1832
so youre saying to mount all those drives onto your c drive and then monitor the entire c drive and then filter the results so only the 1s in the folders you want are displayed?

if this is what you mean, then wouldnt that be quite resource wasteful? and also when you say junction, which command are you talking about? subst, mountvol...? and is there a way to do this purely in ahk.

thanks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 11th, 2007, 12:05 am 
Offline

Joined: June 26th, 2006, 6:14 pm
Posts: 1379
Location: USA
junction is a command line tool you get from m$. Titan mentioned it recently...when talking about custom stdlib directories.

_________________
Image
ʞɔпɟ əɥʇ ʇɐɥʍ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 11th, 2007, 12:06 am 
Offline

Joined: June 26th, 2006, 6:14 pm
Posts: 1379
Location: USA
Ah...here it is:
http://www.autohotkey.com/forum/viewtopic.php?t=23590

_________________
Image
ʞɔпɟ əɥʇ ʇɐɥʍ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 11th, 2007, 12:13 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
tic wrote:
so youre saying to mount all those drives onto your c drive and then monitor the entire c drive and then filter the results so only the 1s in the folders you want are displayed?

It's not exactly mount. Anyway, wasn't this what you really wanted to do?
I always felt that you're ambiguous in saying what you meant/wanted to do. (no offense intended)

Quote:
if this is what you mean, then wouldnt that be quite resource wasteful?

I suppose no more than creating 10 threads for each monitoring.

Quote:
and also when you say junction, which command are you talking about? subst, mountvol...? and is there a way to do this purely in ahk.

Which OS are you using?
If Vista, I think you can use CreateSymbolicLink API, but I can't tell for sure as I have no access to Vista.
If other OS >= W2K, you have to use DeviceIoControl API with FSCTL_SET_REPARSE_POINT/FSCTL_GET_REPARSE_POINT/FSCTL_DELETE_REPARSE_POINT.

Or you may use external tools, like linkd.exe in MS's resource kit, junction.exe from Sysinternals, etc.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 11th, 2007, 11:30 pm 
Offline

Joined: April 22nd, 2007, 6:33 pm
Posts: 1832
I had a look at CreateSymbolicLink but couldnt see how this could be used to do what you described. I wanted this to be able to monitor activity on user defined locations, and did not want to use a 3rd party tool, so was hoping asynchronous mode would be possible.

Why did Joy2DWorld say
Quote:
likely there are better ways, and did not extensively test it, but seemed to work fine for me


Would he be able to post the code he used?

Quote:
I suppose no more than creating 10 threads for each monitoring.


And surely it would be much more resource wasteful. Say for example I define that I wish to monitor C:\test and E:\test\test2 and F:\test\test2\test3

and then there is loads of activity constantly at the location C:\ then every time a file is created/modified/renamed/deleted there, then it would have to be checked, despite it being useless.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 11th, 2007, 11:52 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
tic wrote:
Say for example I define that I wish to monitor C:\test and E:\test\test2 and F:\test\test2\test3

This is the reason why I said you're ambiguous.
As a matter of fact, from your last post I suspected that you might not intend to monitor whole drives but some specific directories, but you had said A:\, B:\, C:\, etc for it.

Anyway, the solution is simple. Remember I said "it's not exactly mount". Just create the junctions for the directories C:\test and E:\test\test2 and F:\test\test2\test3.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 12th, 2007, 12:10 am 
Offline

Joined: April 22nd, 2007, 6:33 pm
Posts: 1832
But im not being ambiguous

Quote:
I wanted this to be able to monitor activity on user defined locations


I want it to be any location. whther it be a drive, many drives, a folder, many folder, or many drives and folders.

I see what you mean about only creating junctions for the folders specified, but I still believe that to be inefficient, but this is besides the point really. id rather have it working and then optimize it.

So how could i create this junction without external tools?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 12th, 2007, 1:22 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
tic wrote:
Quote:
I wanted this to be able to monitor activity on user defined locations

Are you really expecting me to read all your posts, just to answer your question? Does it make sense? Don't you think it's the job of the one who asks to make the question clear? Even my first reply on this thread wasn't toward you.

Quote:
So how could i create this junction without external tools?

Please don't make me repeat myself, I hate to do it. I already said about it. Go figure and choose whatever suits for you.

Quote:
and then there is loads of activity constantly at the location C:\ then every time a file is created/modified/renamed/deleted there

BTW, you don't have to create the junction point always on the root directory. Read again my first post on this thread.


Last edited by Sean on October 12th, 2007, 1:38 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 12th, 2007, 1:38 am 
Offline

Joined: April 22nd, 2007, 6:33 pm
Posts: 1832
Youre being a bit touchy Sean. You dont need to repeat yourself
Quote:
Are you really expecting me to read all your posts, just to answer your question?


Yes, I do. Why even post in a forum if youre not going to read my reply to you

You said it wasnt clear, so i clarified to you, and then you didnt read it, and then say "well its not my job to read your posts". So why ask anything if you wont read the answer?

Quote:
Please don't make me repeat myself, I hate to do it. I already said about it. Go figure and choose whatever suits for you.


Again, youre not reading my posts directed at you. I said I couldnt understand how to use DeviceIoControl. Im sorry if im just too dumb for you to have to have to read my posts, but i feel its a legitimate question that i cannot easily obtain the answer to.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 12th, 2007, 1:51 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
tic wrote:
I said I couldnt understand how to use DeviceIoControl. Im sorry if im just too dumb for you to have to have to read my posts, but i feel its a legitimate question that i cannot easily obtain the answer to.

You didn't say about DeviceIoControl, but about CreateSymbolicLink which appears really simple to use. Anyway, you may ask someone else for it as I myself won't release the code on creating junctions via DeviceIoControl. OK, I think I did it once or twice in the past, but probably I will never again post the codes based on not/ill documented functions, especially if it's a sensitive one. In fact, this one is worse than undocumented.

I'm warning you, you have to be really really careful when dealing with junctions, especially if it's the first time you're about to use it. I suggest to play with it for some time with folders/files which are OK to be lost.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 97 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 7  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot], lblb and 32 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group