473,396 Members | 1,961 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,396 software developers and data experts.

Log file accessed by an external application

38
Hi

I am logging to a text file using System.IO.TextWriter by creating an object like this
logWriter = TextWriter.Synchronized(File.AppendText("loggingFi lename")) .Also I am using lock mechanism to allow multiple threads to log into the same file and it is working fine.
I have got one problem here:

1. When an external application (e.g. Microsoft Word) accesses the log file , my application gets stuck by throwing an error:"The file is being use by another application" . Is there any way to
allow other applicaton like Word to read the log file while it is being wriiten by my application.

Any help will be appreciated...
Jan 21 '08 #1
1 737
Shashi Sadasivan
1,435 Expert 1GB
if you have multiple threads logging into the same file then i say that you are lucky that it has till now not given you that message already.

Some document editors will lock the file for editing, but i use UltraEdit which dosent do anything like that.
Jan 21 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Jim Adamson | last post by:
Hi I want to defer the call of an external .js file so that when the link in the page is clicked, the .js file is downloaded and included in the page. The link would also pass on some arguments...
2
by: Sandor Palfy | last post by:
I have a VS solution with 3 c# class library projects and an "asp.net web application" project. The whole stuff is under integrated source control provided by VSS. The application is under...
3
by: Jeff Robichaud | last post by:
Hello, Since it is possible to put application settings in a file other than web.config, I was wondering what is the best practice in doing so vs. putting these settings directly in web.config....
22
by: fniles | last post by:
I have a .CSV file (comma delimited) that I want to open using OLEDB, but I get the error "External table is not in the expected format." If I save the .CSV file to an .XLS file, I can open the...
16
by: Eran.Yasso | last post by:
Hi, I have a mdb file shared in the LAN. I want to write app that verifies if it's open. If the file is not open, then my app can open the file. if the file is used, then the app won't open it....
3
by: bfmcfarlane | last post by:
I have an appication that allows users to upload and download files. This application is only accessed when a user clicks on an "Upload / Download" link from within our main application. A new...
2
by: sushma | last post by:
Hi all. My Problem is i have an application that launches an external process on a button click. The other process has a feature of accessing a file during its load and also in its formclosing...
2
by: hayyal | last post by:
Hi Folks, Just wanted to know few things about static variables. why static variables cannot be accessed in other files by using extern in c/c++? whats the difference between global and...
4
by: Daniel | last post by:
is there a way to detect if a user tries to access a php file? For instance, db.config.php is called in many php pages but should never actually be open directly. Is there a way to know if...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.