joyent/node — Issue #1897: fs.createWriteStream() in append mode overwrites files on Windows
Author: dmit
Created: 2011-10-15 20:55:56+00:00
State: open

Writing to a file stream that was created in append mode starts at byte 0 and overwrites file contents on Windows. Works fine on Linux.

```
# node -v
v0.5.9

# node
> var fs = require('fs')
> var s1 = fs.createWriteStream('test.txt', {flags: 'a'})
> s1.end('abcdef')
> fs.readFileSync('test.txt', 'utf8')
'abcdef'

> var s2 = fs.createWriteStream('test.txt', {flags: 'a'})
> fs.readFileSync('test.txt', 'utf8')
'abcdef'
> s2.end('ZYX')
> fs.readFileSync('test.txt', 'utf8')
'ZYXdef'
```