473,508 Members | 2,212 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Question about BaseStream.Position

Hi,
I am using a StreamWriter object creaed with a FileStream. At some point I
need to keep the offset of a certain string in the output file, to put in a
cross reference at the end of the file. When I try to use the
BaseStream.Position property (long offset = BaseStream.Position;) I allways
get 0. What should I use? Do I need to keep track of address myself? I need
equivalent of STL tellp().

thanks
Peyman Zehtab-Fard
Nov 15 '05 #1
1 4113
Hi Peyman Zehtab-Fard,

"Peyman Zehtab-Fard" <pe*****@netscape.net> wrote in message
news:9A********************@newsc.telia.net...
Hi,
I am using a StreamWriter object creaed with a FileStream. At some point I
need to keep the offset of a certain string in the output file, to put in a cross reference at the end of the file. When I try to use the
BaseStream.Position property (long offset = BaseStream.Position;) I allways get 0. What should I use? Do I need to keep track of address myself? I need equivalent of STL tellp().


If you haven't already tried this, call StreamWriter.Flush before you
retrieve the BaseStream.Position property.

Regards,
Dan
Nov 15 '05 #2

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

Similar topics

0
1029
by: Daniel Goldman | last post by:
Let's say bw is a BinaryWriter. Any difference between using bw.Seek() and bw.BaseStream.Seek()? I know the methods don't override each other. Is the duplication just a convenience? Any...
0
2847
by: Hai Nguyen | last post by:
Hi Everyone I'm building a C# console application. I need to write data from a text file. The text is something look like this "...From a C++ view there's no difference , between an...
2
12556
by: Harry J. Smith | last post by:
In the code below the two lines marked with ????????????????? do not work properly. The line: inCF.BaseStream.Seek(0, SeekOrigin.Begin); // rewind inCF to beginning of the file...
3
4990
by: Arno | last post by:
Hi, I'm using TcpClient for communication between two PC running a small piece of software. The protocol used has been designed internally and is HTTP similar (command line, headers, body). A...
0
7127
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
7331
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,...
1
7054
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
7501
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...
1
5056
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4713
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...
0
3204
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1564
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 ...
1
768
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.