Ryan Dahl
cda4d56bcf
Implement WriteStream.destroySoon
14 years ago
Ryan Dahl
2957382991
Implement new stream method, destroySoon
Still missing on fs.WriteStream
14 years ago
Ryan Dahl
09329cbb04
more lint
14 years ago
Evan Larkin
bc02d47b21
Fix variable leak.
Fixes issue 461
14 years ago
isaacs
9996b459e1
Implement new path.join behavior
1. Express desired path.join behavior in tests.
2. Update fs.realpath to reflect new path.join behavior
3. Update url.resolve() to use new path.join behavior.
14 years ago
isaacs
589e27948b
writeFile fixes
writeFileSync could exhibit pathological behavior when a buffer could
not be written to the file in a single write() call.
Also, writeFile was not quite as optimized as it could be.
14 years ago
Chandra Sekar S
2b08bacd56
Removed range read optimization as it doesn't work with libeio.
14 years ago
isaacs
987cbbc191
Handle cyclic links smarter in fs.realpath
Rather than aborting in the face of *any* repeated link in a given path,
instead only abort if such a cycle actually makes a given path unresolvable.
Test for this by doing a normal stat. Still use the seenLinks object to
cache link contents so as to cut own a little bit on readlink calls.
Also add a pathological test that fails without the change to fs.js.
14 years ago
Ryan Dahl
901d5fd0d2
Don't require events in fs.js
14 years ago
Ryan Dahl
32aadd9400
fs.ReadStream and fs.WriteStream derive from stream.Stream
14 years ago
Micheil Smith
7bfefb5250
Removed deprecated methods from lib/fs.js
14 years ago
Micheil Smith
e38eb0c5a4
Soft migration of sys -> util, Removal of deprecated utils module.
14 years ago
Joshaven Potter
3d4e4d8909
syntax fixes to pass jslint
14 years ago
isaacs
8ff7954165
Fix #325 . Add test and check for zero-length file contents in fs.readFileSync
14 years ago
Marco Rogers
4a7562d28f
fix encoding option on ReadStream, updated test
14 years ago
Evan Larkin
914ff78df6
fs.ReadStream: Passing null for file position on all reads except the first read of a range read.
14 years ago
Evan Larkin
43ddc04bb0
No longer using the global variable "stat" in unwatchFile
14 years ago
Ryan Dahl
f323f34353
writeable -> writable
14 years ago
Ryan Dahl
069d973d74
Remove require('buffer') in built-in libraries.
14 years ago
isaacs
4d0456f827
Don't use stat in fs.readFile[Sync]
Original patch c/o Evan Larkin <evan.larkin.iit@gmail.com>
14 years ago
Tj Holowaychuk
893ebe7230
Fixed fs.ReadStream() start: 0 bug
14 years ago
Ryan Dahl
6eca948ca2
Move constants out of process object
14 years ago
Ryan Dahl
bbbcd1fee0
Safe constructors for fs.ReadStream and fs.WriteStream
14 years ago
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 ?
14 years ago
Ryan Dahl
3a9570386a
Fix fs.realpathSync('/')
15 years ago
isaacs
ba0c32e2e1
Fix issue #262 . Allow fs.realpath to traverse above the current working directory.
15 years ago
Ryan Dahl
0e501f4ec5
Fix style; undefined reference bug
15 years ago
Tobie Langel
ccf4afa256
Do not emit WriteStream's drain event before ws.write has been called.
15 years ago
Tobie Langel
f5e4047064
Avoid closing a WriteStream before it has been opened.
15 years ago
Tobie Langel
75f922c863
Avoid missing ref error in WriteStream.prototype.destroy().
15 years ago
Ryan Dahl
24ac87f543
Increase ReadStream bufferSize to 64k
15 years ago
Ryan Dahl
3c00ec4e48
typo: forceClose -> destroy for WriteStreams
15 years ago
Marco Rogers
af9aa93e0c
fix for fs.readFile to return string when encoding specified on zero length read
15 years ago
Marco Rogers
9c7c6e93e1
Fixed async fs writes with length 0, it should fire the callback
15 years ago
Russell Haering
6078c37be5
Modify fs.open to use accept a callback without a mode
15 years ago
Marco Rogers
6744e59e46
detect 0 length fs writes with tests
15 years ago
Ryan Dahl
3d551e5538
Close fd on readFile(emptyfile)
15 years ago
Chandra Sekar S
f5f7cb9264
Support for reading byte ranges from files using fs.createReadStream.
15 years ago
Ryan Dahl
458bbb4687
fs.writeSync should return bytes written
15 years ago
Ryan Dahl
02729d4af7
instanceof Buffer to Buffer.isBuffer()
15 years ago
Aaron Heckmann
1d088fb906
fs.writeFile accepts Buffers
15 years ago
Peter Dekkers
e48f0d1dd9
Fixed incorrect mask for determining fs.Stats types
15 years ago
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.
15 years ago
Felix Geisendörfer
5f3906b65e
Fix: fs.writeFile could not handle utf8
15 years ago
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.
15 years ago
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
15 years ago
Ryan Dahl
8840ce340d
Bugfix: fs.ReadStream.setEncoding
Improve test-fs-read-stream test.
15 years ago
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.
15 years ago
Ryan Dahl
19f475c573
fs.ReadStream should emit Buffers
And do proper utf8 encoding.
15 years ago
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.
15 years ago