Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > VS.NET 2002/2003
|
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 1st, 2003, 05:47 AM
Registered User
 
Join Date: Aug 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default SOS : FileStream Fileaccess Problem!

Hi,
I have a problem.. I need to write to a file (for a logging component) and I need to give a read access to the file for other applications to read even when the component is writing to the file.
I did like this..
FileStream fs=File.Open(@"C:\a.txt",FileMode.Append,FileAcces s.Write,FileShare.Read);
sw=new StreamWriter(fs);

sw.WriteLine("Some thing to write..");

I cant close the filestream or the writer.. now if i try to access the file . The access denied error is coming..
Am i missing something here! I have given the Fileshare.read permission!


Any pointers is greatly welcomed!


Warm Regards,
Aravinthan N
[email protected]





Similar Threads
Thread Thread Starter Forum Replies Last Post
FileStream vs StreamWriter Makolyte C# 2005 0 June 22nd, 2007 01:22 PM
How to convert HttpPostedFile to FileStream vinod_pawar1 HTML Code Clinic 1 August 13th, 2005 04:21 AM
Please Help me!(SOS) zhangmin XML 1 March 12th, 2004 05:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.