Re: long line truncated on vista 2048



On Oct 25, 7:10 pm, Peter Duniho <NpOeStPe...@xxxxxxxxxxxxxxxx> wrote:
pmo wrote:
I'm writing to a logfile in My Documents.
I'm want to write a rather long line approximately 2200 chars.

On XP it works as expected but onVistaonly the first2048chars are
written.
Does anyone know why and how to get around it?

I tried both StreamWriter,File.AppendAllText and File.WriteAllText

What is the exact content of the file you're writing? Are there other,
shorter lines that are present and which are not truncated? Or is there
just this one long line? Or is the long line at the end of the file?

If any of the latter, are you sure that you are correctly flushing and
closing the stream? Failing to do so would be a common way for data to
not get completely written to a file (but I would expect AppendAllText
and WriteAllText to correctly handle this, so who knows?)

Generally speaking, if you can write text to a file at all, the text
will always be written correctly. So either the text isn't actually
being written to the file, or you are not using a correct means to
determine whether the text is actually in the file or not.

Pete
Sorry for the delayed reply.

It's just one long line at this point in the data file, in the logfile
its one of many shorter lines.
I tried using streamwriter so that I could do a proper close after
writing, did not help. Whats pussling is that it breaks inside a
token. The write statement is as can be.

string text = join(_defaultTokens, _separator);
File.WriteAllText(path, text, Encoding.Default);


I'm going to install visual studio on a vista box so that I can run it
through the debugger and look at 'text'

/pmo

.