Question about BaseStream.Position

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peyman Zehtab-Fard

    #1

    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.Posi tion property (long offset = BaseStream.Posi tion;) 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


  • Daniel Pratt

    #2
    Re: Question about BaseStream.Posi tion

    Hi Peyman Zehtab-Fard,

    "Peyman Zehtab-Fard" <peymanz@netsca pe.net> wrote in message
    news:9ADhb.3235 1$dP1.100605@ne wsc.telia.net.. .[color=blue]
    > 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[/color]
    a[color=blue]
    > cross reference at the end of the file. When I try to use the
    > BaseStream.Posi tion property (long offset = BaseStream.Posi tion;) I[/color]
    allways[color=blue]
    > get 0. What should I use? Do I need to keep track of address myself? I[/color]
    need[color=blue]
    > equivalent of STL tellp().[/color]

    If you haven't already tried this, call StreamWriter.Fl ush before you
    retrieve the BaseStream.Posi tion property.

    Regards,
    Dan


    Comment

    Working...