473,395 Members | 1,440 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Security context of worker threads

Still working on this [insert stream of invective here] project.

What I have working: I have a service that uses FileSystemWatcher on an
"in box" folder. When a text file appears in the in-box, it copies the
file to a work folder, processes it a bit, goes through a list of rules
and applies the first one that fits. Based on the applied rule, the file
can be printed, copied or deleted, or a user can be sent an email
notification.

I ran in to a problem where FileSystemWatcher receives a notification
and begins the above process, but the file has not been completely
released by the system (usually because it has not finished being
written.) I've inserted some delays but I need for the delays to
eventually give up and go on to the next file, if any. As a result, I
occasionally get files that have been orphaned, where the service timed
out and so left them in the in-box. I can deal with these manually by
restarting the service; it was written to deal with any text files in
the in-box during the startup event.

Enter threading. My thought was to spawn a worker thread for each file,
which could wait indefinitely until the file becomes available. Threads
are spawning properly, but when they get to the command to move the file
in to the working folder.... UnauthorizedAccessException, "Access to the
path is denied." Then the threads end properly. The one problem seems to
be the security context of the worker thread. This error appears both
when a file is written to the in-box and when there is a file in the
in-box on server startup.

I have both the in-box and the worker folder set so that "Everyone" has
full control over the folders, subfolders and files. I am running the
service as LocalService, which has full control over the folders,
subfolder and file. My every effort to find out the security context of
the worker thread has been baffled by (surprise, surprise) piss poor
documentation. Any help would be much appreciated.

Particulars: VS.NET 2.0, VB programming language, XP sp 2 operating
system
--
Gregory Gadow
te******@serv.net

Jan 31 '06 #1
0 1145

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mark Hoffman | last post by:
All, From what I've read, the CLR gives each App Domain a thread pool of 25 threads, and once this pool is exhausted then any new threads created with BeginInvoke will block until the pool frees...
4
by: hazz | last post by:
If I successfully run a VS.NET app which includes the following; ************************** APP 1 **************************** m_iIdnt = new...
4
by: Nikolay Petrov | last post by:
Hi everyone! I am developing app, which should be used by users, which are members of different groups. These users and groups are stored in my SQL database and are custom for my application,...
2
by: Sparky | last post by:
Hi I have an vb.net winforms application that needs to launch a thread, and within that thread change the security context of the current user to a new one using impersonation. For clarity, the...
7
by: Charles Law | last post by:
My first thought was to call WorkerThread.Suspend but the help cautions against this (for good reason) because the caller has no control over where the thread actually stops, and it might have...
13
by: Michael M. | last post by:
In Perl, it was: ## Example: "Abc | def | ghi | jkl" ## -"Abc ghi jkl" ## Take only the text betewwn the 2nd pipe (=cut the text in the 1st pipe). $na =~ s/\ \|(.*?)\ \|(.*?)\ \|/$2/g;...
3
by: Kevin | last post by:
Using this: http://msdn2.microsoft.com/en-us/library/3dasc8as(VS.80).aspx as an example I have a question concerning the reuse of objects. In the example 10 instances of the Fibonacci class...
7
by: csharpula csharp | last post by:
Hello, I got a question regarding the usage of background worker. How can I run few threads via background worker with different objects as parameter each time. I understood that I can't do...
5
by: Henry Stock | last post by:
I am trying to understand the following error: Any thing you can tell me about this is appreciated. Security Exception Description: The application attempted to perform an operation not allowed...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.