isaacs
4d0456f827
Don't use stat in fs.readFile[Sync]
...
Original patch c/o Evan Larkin <evan.larkin.iit@gmail.com>
2010-09-22 22:06:32 -07:00
Tj Holowaychuk
893ebe7230
Fixed fs.ReadStream() start: 0 bug
2010-09-22 10:22:43 -07:00
Ryan Dahl
6eca948ca2
Move constants out of process object
2010-09-16 23:16:07 -07:00
Ryan Dahl
bbbcd1fee0
Safe constructors for fs.ReadStream and fs.WriteStream
2010-09-16 19:04:09 -07:00
isaacs
686d9f9cc6
Bug in realpath with symlinks to absolute folder paths which have children.
...
Found by Cliffano Subagio
http://groups.google.com/group/nodejs/browse_thread/thread/f46f093938265ac0/387e14da08c7dd7b ?
2010-09-14 10:27:57 -07:00
Ryan Dahl
3a9570386a
Fix fs.realpathSync('/')
2010-09-09 18:49:28 -07:00
isaacs
ba0c32e2e1
Fix issue #262 . Allow fs.realpath to traverse above the current working directory.
2010-09-08 17:35:58 -07:00
Ryan Dahl
0e501f4ec5
Fix style; undefined reference bug
2010-09-08 12:03:33 -07:00
Tobie Langel
ccf4afa256
Do not emit WriteStream's drain event before ws.write has been called.
2010-09-08 11:58:54 -07:00
Tobie Langel
f5e4047064
Avoid closing a WriteStream before it has been opened.
2010-09-08 11:51:29 -07:00
Tobie Langel
75f922c863
Avoid missing ref error in WriteStream.prototype.destroy().
2010-09-08 11:50:56 -07:00
Ryan Dahl
24ac87f543
Increase ReadStream bufferSize to 64k
2010-09-08 10:14:04 -07:00
Ryan Dahl
3c00ec4e48
typo: forceClose -> destroy for WriteStreams
2010-09-05 02:27:02 -07:00
Marco Rogers
af9aa93e0c
fix for fs.readFile to return string when encoding specified on zero length read
2010-08-30 14:08:18 -07:00
Marco Rogers
9c7c6e93e1
Fixed async fs writes with length 0, it should fire the callback
2010-08-30 13:58:50 -07:00
Russell Haering
6078c37be5
Modify fs.open to use accept a callback without a mode
2010-08-23 02:42:25 -07:00
Marco Rogers
6744e59e46
detect 0 length fs writes with tests
2010-08-16 23:57:01 -07:00
Ryan Dahl
3d551e5538
Close fd on readFile(emptyfile)
2010-08-10 14:47:40 -07:00
Chandra Sekar S
f5f7cb9264
Support for reading byte ranges from files using fs.createReadStream.
2010-07-21 11:33:35 -07:00
Ryan Dahl
458bbb4687
fs.writeSync should return bytes written
2010-07-16 19:05:28 -07:00
Ryan Dahl
02729d4af7
instanceof Buffer to Buffer.isBuffer()
2010-07-15 15:58:35 -07:00
Aaron Heckmann
1d088fb906
fs.writeFile accepts Buffers
2010-06-15 23:58:32 -07:00
Peter Dekkers
e48f0d1dd9
Fixed incorrect mask for determining fs.Stats types
2010-06-15 19:52:37 -07:00
Ryan Dahl
6bed15e074
Refactor: Utf8Decoder -> StringDecoder
...
Instead of just decoding Utf8, this will proxy requests to buffer.toString()
for other encodings. This makes for a simpler interface.
2010-06-15 18:19:27 -07:00
Felix Geisendörfer
5f3906b65e
Fix: fs.writeFile could not handle utf8
2010-06-14 10:58:17 -07:00
Felix Geisendörfer
55e964ec19
Fix: fs.readFile would execute callbacks twice
...
fs.readFile was executing a callback in a try..catch context, which is
a problem in itself. To make matters worse, it would re-execute the
same callback if there was an execution.
This patch fixes both of these problems.
2010-06-03 09:40:40 -07:00
Ryan Dahl
1a5acd9850
API: readFileSync without encoding argument now returns a Buffer
...
Correctly load utf8 data; add a test test-fs-read-file-sync.js
2010-05-29 13:38:00 -07:00
Ryan Dahl
8840ce340d
Bugfix: fs.ReadStream.setEncoding
...
Improve test-fs-read-stream test.
2010-05-26 18:33:38 -07:00
Micheil Smith
d89de07758
Adding experimental support for fs.chown and fs.chownSync.
...
Notes:
- Currently only accepts numeric user and group ids.
- No tests, as tests depend on getpwuid and getgrgid.
- No documentation, as there is no tests and this is experimental.
2010-05-26 13:37:45 -07:00
Ryan Dahl
19f475c573
fs.ReadStream should emit Buffers
...
And do proper utf8 encoding.
2010-05-24 15:47:42 -07:00
Felix Geisendörfer
c93e0aaf06
Deprecate string interface for fs.read()
...
This patch makes buffers the preferred output for fs.read() and
fs.readSync(). The old string interface is still supported by
converting buffers to strings dynamically. This allows to remove the
C++ code for string handling which is also part of this patch.
2010-05-20 16:31:18 -07:00
Ryan Dahl
e84395ff8c
Revert "Deprecate string interface for fs.read()"
...
This reverts commit cbbf9e43d1
.
2010-05-20 16:11:33 -07:00
Felix Geisendörfer
cbbf9e43d1
Deprecate string interface for fs.read()
...
This patch makes buffers the preferred output for fs.read() and
fs.readSync(). The old string interface is still supported by
converting buffers to strings dynamically. This allows to remove the
C++ code for string handling which is also part of this patch.
2010-05-20 15:25:49 -07:00
isaacs
5b740c488f
Fix a leaking global
2010-05-20 09:38:25 -07:00
Felix Geisendörfer
c46cbe0de4
Deprecate string interface for fs.write()
...
This patch makes buffers the preferred input for fs.write() and
fs.writeSync(). The old string interface is still supported by
converting strings to buffers dynamically. This allows to remove the
C++ code for string handling which is also part of this patch.
2010-05-19 12:53:43 -07:00
Ryan Dahl
e232f09d38
fs.WriteStream.write should support buffer
...
Also re-adding the callback parameter.
2010-05-17 19:44:14 -07:00
Andrew Johnston
9599607065
Added posix fsync and fdatasync to fs module
2010-05-14 18:42:22 -07:00
Elijah Insua
976926376d
Handle empty files with fs.readFile
2010-05-13 12:42:17 -07:00
Ben Noordhuis
c6c77d535f
Support for fstat(2) through fs.fstat() and fs.fstatSync(). Added test cases, updated documentation.
2010-05-12 14:20:43 -07:00
isaacs
bc45adcffa
Add binding.close to fs.readFile
2010-05-07 13:17:57 -07:00
Tim Caswell
c07c601c3b
fs.readFile uses a buffer internally and will return the raw buffer if no encoding is specified.
2010-05-06 22:22:14 -07:00
Jonathan Knezek
82c8973dfa
Changed undefined pos to null to prevent hanging on SheevaPlug
2010-05-05 22:34:36 -07:00
Ryan Dahl
e7a1fa1293
fs.FileWriteStream -> fs.WriteStream, fs.FileReadStream -> fs.ReadStream
2010-04-27 18:52:16 -07:00
Felix Geisendörfer
c143cba590
Get rid of coupling for stdin
2010-04-27 18:02:30 -07:00
Felix Geisendörfer
f2212fa59d
Support for FileReadStream.setEncoding
2010-04-27 17:31:04 -07:00
Felix Geisendörfer
76f98c27de
Get rid of coupling for stdout
2010-04-27 17:27:34 -07:00
Ryan Dahl
f618551694
Remove callback argument to FileWriteStream.prototype.write
2010-04-27 17:26:10 -07:00
Brian Hammond
40820ec8d5
Leave pos as undefined to allow reads from unseekable files like /proc/x/smaps on Linux
2010-04-23 10:34:10 -07:00
Tim Caswell
62d9852c3d
Replace slow and broken for..in loops with faster for loops over the keys.
2010-04-12 10:34:35 -07:00
isaacs
57fbb627ca
trailing whitespace fixes
2010-04-11 14:48:23 -07:00