[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework

FileSystemWatcher rename parent folder

D2

9/9/2008 5:29:00 AM

Hi,

I am watching for file system events in a folder "D:\Watcher\Watch"
folder which is working perfectly fine. However, this prevents user
from renaming the parent folder (in this case "d:\watcher" folder).
Now customer wants the ability that the user should be able to rename
the parent folder. Does anyone has an idea how can this be achieved?

cheers!
d2
3 Answers

Patrice

9/10/2008 11:33:00 AM

0

I doubt this is possible. It would be similar to moving a file while reading
from the same file.

The best I can think of would be to make sure the directory is under a root
directory that can't be renamed. Or watching the drive would work but this
is likely not something you want to do...

IMO the reasonable answer would be :
- the application needs to be stopped (or paused), the name changed, the app
restarted
- you can do whatever you want under <location> while the app is running.
You can't change <location> itself... (i..e if
d:\somethingYouCanTchange\Watcher then you can rename the watcher directory
but not the containing directory).

Knowing the big picture could help (what kind of app is this ? etc...)

--
Patrice


"D2" <dhapola@yahoo.com> a écrit dans le message de groupe de discussion :
e7d8f30e-465d-4803-b315-a070ddf50b14@m36g2000hse.googlegroups.com...
> Hi,
>
> I am watching for file system events in a folder "D:\Watcher\Watch"
> folder which is working perfectly fine. However, this prevents user
> from renaming the parent folder (in this case "d:\watcher" folder).
> Now customer wants the ability that the user should be able to rename
> the parent folder. Does anyone has an idea how can this be achieved?
>
> cheers!
> d2


D2

9/11/2008 5:01:00 PM

0

Hi,

Thanks for your reply and suggestion. Well, this is a windows service
which is watching certain folders for changes.
What I want to achieve is... if folder "D:\Watcher\Watch" is being
watched then user should be able to rename.. at the same time this
service should internally start monitoring renamed folder i.e. if user
renamed d:\Watcher to d:\monitor, this service should start watching d:
\monitor.

thanks,
d2

On Sep 10, 4:32 pm, "Patrice" <http://www.chez.com/s... wrote:
> I doubt this is possible. It would be similar to moving a file while reading
> from the same file.
>
> The best I can think of would be to make sure the directory is under a root
> directory that can't be renamed. Or watching the drive would work but this
> is likely not something you want to do...
>
> IMO the reasonable answer would be :
> - the application needs to be stopped (or paused), the name changed, the app
> restarted
> - you can do whatever you want under <location> while the app is running.
> You can't change <location> itself... (i..e if
> d:\somethingYouCanTchange\Watcher then you canrenamethe watcher directory
> but not the containing directory).
>
> Knowing the big picture could help (what kind of app is this ? etc...)
>
> --
> Patrice
>
> "D2" <dhap...@yahoo.com> a écrit dans le message de groupe de discussion :
> e7d8f30e-465d-4803-b315-a070ddf50...@m36g2000hse.googlegroups.com...
>
> > Hi,
>
> > I am watching for file system events in afolder"D:\Watcher\Watch"
> >folderwhich is working perfectly fine. However, this prevents user
> > from renaming theparentfolder(in this case "d:\watcher"folder).
> > Now customer wants the ability that the user should be able torename
> > theparentfolder. Does anyone has an idea how can this be achieved?
>
> > cheers!
> > d2

Patrice

9/12/2008 10:58:00 AM

0

IMO this is not possible the service will have to be stopped and
restarted... You may want to ask in a win32 group as this limitation is
likely what you have just in the low level win32 api...

--
Patrice

"D2" <dhapola@yahoo.com> a écrit dans le message de groupe de discussion :
10a42763-a46f-431a-b365-e7438d61e013@q5g2000prf.googlegroups.com...
> Hi,
>
> Thanks for your reply and suggestion. Well, this is a windows service
> which is watching certain folders for changes.
> What I want to achieve is... if folder "D:\Watcher\Watch" is being
> watched then user should be able to rename.. at the same time this
> service should internally start monitoring renamed folder i.e. if user
> renamed d:\Watcher to d:\monitor, this service should start watching d:
> \monitor.
>
> thanks,
> d2
>
> On Sep 10, 4:32 pm, "Patrice" <http://www.chez.com/s... wrote:
>> I doubt this is possible. It would be similar to moving a file while
>> reading
>> from the same file.
>>
>> The best I can think of would be to make sure the directory is under a
>> root
>> directory that can't be renamed. Or watching the drive would work but
>> this
>> is likely not something you want to do...
>>
>> IMO the reasonable answer would be :
>> - the application needs to be stopped (or paused), the name changed, the
>> app
>> restarted
>> - you can do whatever you want under <location> while the app is running.
>> You can't change <location> itself... (i..e if
>> d:\somethingYouCanTchange\Watcher then you canrenamethe watcher directory
>> but not the containing directory).
>>
>> Knowing the big picture could help (what kind of app is this ? etc...)
>>
>> --
>> Patrice
>>
>> "D2" <dhap...@yahoo.com> a écrit dans le message de groupe de discussion
>> :
>> e7d8f30e-465d-4803-b315-a070ddf50...@m36g2000hse.googlegroups.com...
>>
>> > Hi,
>>
>> > I am watching for file system events in afolder"D:\Watcher\Watch"
>> >folderwhich is working perfectly fine. However, this prevents user
>> > from renaming theparentfolder(in this case "d:\watcher"folder).
>> > Now customer wants the ability that the user should be able torename
>> > theparentfolder. Does anyone has an idea how can this be achieved?
>>
>> > cheers!
>> > d2
>