472,960 Members | 1,776 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

flush works , but there is a time issue.

(a little more info)
after flushing the line (instead of closing streamwirter)
it takes some x time to flush the line
so, when I read from the file I cannot find the last written line.

if I close the streamwriter it does find the line always.
but , my next write fails "Cannot write to a closed TextWriter"

Aug 6 '08 #1
5 1893
raulavi wrote:
(a little more info)
after flushing the line (instead of closing streamwirter)
it takes some x time to flush the line
so, when I read from the file I cannot find the last written line.

if I close the streamwriter it does find the line always.
but , my next write fails "Cannot write to a closed TextWriter"
Flushing the StreamWriter doesn't flush the underlying FileStream. You
have to flush that after flushing the StreamWriter for the line to end
up in the file.

--
Göran Andersson
_____
http://www.guffa.com
Aug 6 '08 #2
Thanks Goran...
Sorry, could you explain a lit bit .

so how is this process done?

write a line
?????close, flush or what???

????what do we need here to
read the last line written

"Göran Andersson" wrote:
raulavi wrote:
(a little more info)
after flushing the line (instead of closing streamwirter)
it takes some x time to flush the line
so, when I read from the file I cannot find the last written line.

if I close the streamwriter it does find the line always.
but , my next write fails "Cannot write to a closed TextWriter"

Flushing the StreamWriter doesn't flush the underlying FileStream. You
have to flush that after flushing the StreamWriter for the line to end
up in the file.

--
Göran Andersson
_____
http://www.guffa.com
Aug 7 '08 #3
On Thu, 07 Aug 2008 08:53:01 -0700, raulavi
<ra*****@discussions.microsoft.comwrote:
Thanks Goran...
Sorry, could you explain a lit bit .

so how is this process done?
StreamWriter writer = ...;

writer.Flush();
writer.BaseStream.Flush();

Pete
Aug 7 '08 #4
Thanks Peter and Goran,

I will test it.

"Peter Duniho" wrote:
On Thu, 07 Aug 2008 08:53:01 -0700, raulavi
<ra*****@discussions.microsoft.comwrote:
Thanks Goran...
Sorry, could you explain a lit bit .

so how is this process done?

StreamWriter writer = ...;

writer.Flush();
writer.BaseStream.Flush();

Pete
Aug 7 '08 #5
writer.BaseStream.Flush();

is the solution... at least for my prototype. Lets see the real thing..

thanks againg to all.

"Peter Duniho" wrote:
On Thu, 07 Aug 2008 08:53:01 -0700, raulavi
<ra*****@discussions.microsoft.comwrote:
Thanks Goran...
Sorry, could you explain a lit bit .

so how is this process done?

StreamWriter writer = ...;

writer.Flush();
writer.BaseStream.Flush();

Pete
Aug 7 '08 #6

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

Similar topics

7
by: Jon Spivey | last post by:
Experimenting with response.flush() but can't seem to get it to work. This code <% response.write "<p>started</p>" response.flush() for i = 1 to 10000000 i = i +1 next response.write...
30
by: Jonathan Neill | last post by:
I'm aware that there is no ANSI (or POSIX, or any standard, to my knowledge) way of flushing stdin or any other application-level input buffer, but if anyone knows a hack or a non-portable way to...
11
by: Junkguy | last post by:
I need some help programmatically causing a row in a DataGrid to "flush" its contents to its bound data (in Visual Studio 6 using Windows Forms with C#). My issue is I want to send an update to...
0
by: Matthias Straka | last post by:
Hi! I'm working on a website with an IHttpHandler that listens to changes ina database and sends some text to the client. The client is always connected to the handler, this way I can use a...
1
by: nitroamos | last post by:
i'm working on improving the IO for the software project i'm working on to do two extra things. first, i'm going to add HDF5 functionality, and second, add the ability to write binary output. the...
12
by: Daniel Kaplan | last post by:
I was curious about something. In the same table cell I can say this: <A HREF="menu.pl" ><IMG SRC="menu.jpg" width="95" height="35" border="0"></A> <A HREF="help.pl" ><IMG SRC="help.jpg"...
2
by: Kiran | last post by:
Hello Everybody! I am writing a networking application in python for a small piece of hardware, in which there could sometimes be timeouts. I am using sockets to communicate to this device. Data...
1
by: asleepatdesk | last post by:
I am still maintaining/developing a classic ASP application. I have recently built into the app architecture AJAX functionality which works pretty well. The issue: a client wants a report built...
2
by: Damir | last post by:
Hello! I have noticed that after (sucessfully) executing the command: FLUSH PACKAGE CACHE DYNAMIC the dynamic SQL statement cache is not completely cleared (some of the dynamic SQL statement...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.