473,626 Members | 3,093 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Issuing Multiple seeks to a FileStream

I have a file that I open a FileStream and a StreamReader for. I issue a SEEK
and
read a series of records. I then issue another SEEK, no errors, but when I
issue
the read it picks up where the first read stopped.

I have to close the FileStream and the StreamReader, reopen them and then
issue the second SEEK. I tried issuing a FLUSH before the second SEEK but
the results were the same.

Is this the way it is supposed to work?

Why can't I issuse multiple seeks to a FileStream?

Nov 21 '05 #1
0 1306

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

Similar topics

0
291
by: James Johnson | last post by:
I have a file that I open a FileStream and a StreamReader for. I issue a SEEK and read a series of records. I then issue another SEEK, no errors, but when I issue the read it picks up where the first read stopped. I have to close the FileStream and the StreamReader, reopen them and then issue the second SEEK. I tried issuing a FLUSH before the second SEEK but the results were the same.
6
1746
by: cj | last post by:
I'm tryin to set up a sqlcommand in VB.NET that would issue the command: insert into server1.database.owner.table select * from server2.database.owner.table Since this sqlcommand has it's connection property set to a connection string for server1 I'm assuming it isn't seeing server2 -- I get invalid object name server2. How can I get one sql statement to reference multiple servers?
5
13457
by: Ahmad Jalil Qarshi | last post by:
Hi! I have a class named CClassToSerialize that contain some boolean, string and few custom variable types. Now when I create only a single Object and Serialize/Deserialize everything is fine. But I want to save more than one Object of this class into same file.
5
3969
by: cybersangeeth | last post by:
Hi, I need to read 1KB each time from multiple files in a folder and pass it to a byte array in a struct to be sent through a socket. I'm a C++ newbie. I managed to read 1KB each time from one file and store it on to another file using the following code. Could anyone please let me know how i could go about reading from multiple files. Thanks in advance. typedef struct {
5
4946
by: paul_zaoldyeck | last post by:
does anyone know how to validate an xml file against multiple defined schema? can you show me some examples? i'm making here an xml reader.. thank you
0
1053
by: amitp | last post by:
Can anyone help me out in this? I want to append multiple RTF file into one RTF file. I tried using 'streamwriter', the resulting file size becomes big and when i open it, it is the original i.e the first RTF file only and not the appended one. But i open the file with notepad it looks appended. I've supplied my code below . I've searched thru internet a lot but didn't get anything. So if anybody hav a solution plz help me out. I'll explain...
10
4495
by: Frankie | last post by:
It appears that System.Random would provide an acceptable means through which to generate a unique value used to identify multiple/concurrent asynchronous tasks. The usage of the value under consideration here is that it is supplied to the AsyncOperationManager.CreateOperation(userSuppliedState) method... with userSuppliedState being, more or less, a taskId. In this case, the userSuppliedState {really taskId} is of the object type,...
2
2956
by: Elikhom | last post by:
Is there any way to open multiple files concurrently and for example read the first line of each and the do some task with them, then read the second line of all of them and do some task again with them, etc until all of them are finished? for (int i = 0; i < (int)products.size(); i++) { string fileName = folder + "\\" + products + "_" + parameters_.getDate() + ".csv"; fileNames_.push_back(fileName); ifstream...
2
294
by: tshad | last post by:
I tried to put multiple objects in one using statements like so: using (fs = new FileStream(fromImagePath + "\\" + (string)dr, FileMode.Open, System.IO.FileAccess.Read) , BinaryReader br = new BinaryReader(fs)) But I get an error: ") expected"
0
8696
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8637
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8358
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8502
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7188
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5571
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4195
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2621
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1805
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.