Commit Graph

56 Commits

Author SHA1 Message Date
Bert Belder
3da9504beb windows: map ERROR_INVALID_HANDLE to UV_EBADF 2012-06-22 20:04:07 +02:00
Bert Belder
d0950dd491 windows: whitespace fixes 2012-06-22 20:04:06 +02:00
Bert Belder
ea3e2cd480 windows: get rid of overly complicated uv_filetime_to_time_t helper 2012-06-22 01:45:19 +02:00
Bert Belder
da59427c66 windows: don't set WT_EXECUTELONGFUNCTION for fs operations 2012-06-21 02:37:44 +02:00
Bert Belder
d402604118 windows: inline a couple of inline request functions 2012-06-02 23:08:22 +02:00
Igor Zinkovsky
2df831723f windows: set flags for uv_fs_symlink 2012-05-22 16:32:17 -07:00
Igor Zinkovsky
253d718572 report correct error 2012-05-22 15:58:01 -07:00
Igor Zinkovsky
60af28abab windows: support junctions with uv_fs_synlink
based on @piscisaureus implementation
2012-05-17 09:53:26 -07:00
Ben Noordhuis
9efa8b3571 unix, windows: rework reference counting scheme
This commit changes how the event loop determines if it needs to stay alive.

Previously, an internal counter was increased whenever a handle got created
and decreased again when the handle was closed.

While conceptually simple, it turned out hard to work with: you often want
to keep the event loop alive only if the handle is actually doing something.
Stopped or inactive handles were a frequent source of hanging event loops.

That's why this commit changes the reference counting scheme to a model where
a handle only references the event loop when it's active. 'Active' means
different things for different handle types, e.g.:

 * timers: ticking
 * sockets: reading, writing or listening
 * processes: always active (for now, subject to change)
 * idle, check, prepare: only active when started

This commit also changes how the uv_ref() and uv_unref() functions work: they
now operate on the level of individual handles, not the whole event loop.

The Windows implementation was done by Bert Belder.
2012-05-17 07:07:53 +02:00
Bert Belder
4365896921 Windows: skip GetFileAttributes call when opening a file
It wasn't working, and everything seemed to work fine nonetheless. Removing it just saves a syscall.
2012-05-04 14:31:48 -07:00
Keno Fischer
d13b1e0803 Windows: fix uv_fs_ftruncate to compile with Mingw32
Close: #382, #397
Ref: #381
2012-04-29 02:32:27 +02:00
Igor Zinkovsky
d5acfd0c05 64bit offsets for fs operations and cleanup uv_fs_* for uv-win 2012-04-18 11:05:27 -07:00
Bert Belder
ec97ba8014 Windows uv_fs_stat: cap st_nlink to SHRT_MAX 2012-03-09 05:00:10 +01:00
Brandon Philips
fca18c33ac win: fs: handle EOF in read
in luvit after upgrade libuv from 243cfc to d3efef readSync started
failing.  It seems that the code cleanup stopped handling EOF

Trivially reproduced with this

    local fs = require('fs')
    print(fs.readFileSync('foo.luvit'))
2012-02-24 00:58:53 +01:00
Bert Belder
6c80bf34d3 Clean up error handling in win/fs.c, add some error mappings 2012-02-13 20:01:19 +01:00
Bert Belder
267e75dda2 Windows: better stat implementation 2012-02-02 17:03:40 +01:00
Brandon Benvie
74cff551d5 windows: fix off-by-one error in uv_fs_stat
uv__is_root typo caused incorrect fs.exists results in Node.
2012-01-28 16:52:44 +01:00
Bert Belder
92b260c065 windows: fix stat("c:\\") regression 2012-01-27 22:09:55 +01:00
Igor Zinkovsky
855764406e windows: improve uv_fs_stat performance (by about 60%) 2012-01-11 19:21:47 -08:00
Igor Zinkovsky
43e3ac5798 windows: uv_fs_rename to replace the new file if it exists
fixes #283
2011-12-30 15:48:22 -08:00
Bert Belder
b4698d414b Strip trailing whitespace 2011-11-25 10:03:27 +01:00
Igor Zinkovsky
cfa4112950 windows: make uv_fs_stat use open + fstat to support long paths 2011-11-24 19:18:17 -08:00
Igor Zinkovsky
942c68b80e windows: fix utf16->utf8 conversion in uv_fs_readdir 2011-11-08 19:23:30 -08:00
Igor Zinkovsky
fe97c4dc63 windows: honor O_APPEND in uv_fs_open 2011-11-04 12:41:23 -07:00
Bert Belder
179f475b2a win: fix fs__readdir buffer overflow bug
Thanks Runner Mei for pointing this out. Closes GH-224.
2011-10-21 18:42:40 -07:00
Igor Zinkovsky
fd9dbb1279 fix mingw build 2011-10-12 21:46:06 -07:00
Igor Zinkovsky
72b5976e83 windows: support utf8 in uv_fs functions
fixes #201
2011-10-12 13:24:22 -07:00
Igor Zinkovsky
81303a72be fix fs_readdir_file on windows 2011-10-12 11:37:22 -07:00
Igor Zinkovsky
2216d38c29 windows: enable uv_fs_open to open directories 2011-10-12 10:42:41 -07:00
Igor Zinkovsky
72fb469a43 windows: check for fd==-1 in uv_fs functions 2011-10-11 18:22:10 -07:00
Igor Zinkovsky
40b64a81cb windows: don't alloc readdir buffer for empty dirs 2011-10-11 11:47:05 -07:00
Igor Zinkovsky
c9ae7a6f95 windows: don't strip the trailing slash from filename if it follows a device name 2011-09-28 12:59:39 -07:00
Igor Zinkovsky
4fb120f649 windows: fix error reporting for uv_fs_ functions 2011-09-28 12:46:37 -07:00
Erick Tryzelaar
23796d208c Fixes #76. Unify OS error reporting
As a nice fringe benefit, this also shaves a word
off of a windows TCP handle by replacing "uv_err_t
bind_error" with "int bind_error".
2011-09-27 19:05:33 -07:00
Igor Zinkovsky
4197fc76b1 windows: make file handles non-inheritable by default to match node behavior 2011-09-14 13:33:55 -07:00
Igor Zinkovsky
2931bdcf54 windows: strip '\??\' from readlink path buffer. 2011-09-14 12:58:18 -07:00
Igor Zinkovsky
65c8a727a3 uv_fs_ functions to return result in sync mode 2011-09-14 11:47:49 -07:00
Igor Zinkovsky
cfa1423f96 fix fs_file_noent on windows 2011-09-08 18:23:19 -07:00
Bert Belder
0d373eb0b1 win: fix bug in fs__readlink 2011-09-09 01:25:52 +02:00
Bert Belder
2d1c672e2d More MinGW fixes 2011-09-08 23:49:46 +02:00
Bert Belder
06d69a82ee Make MinGW happy again 2011-09-08 20:19:32 +02:00
Bert Belder
58ef43eee7 win: use win32 api for file reading and writing 2011-09-06 00:45:56 +02:00
Igor Zinkovsky
a8017fd8a2 windows: update uv_fs_* functions to work with req.path 2011-09-04 23:58:31 -07:00
Igor Zinkovsky
b90459fc81 windows: use _stati64 2011-09-04 23:31:25 -07:00
Ryan Dahl
be3b37854e win: initialize req.path = NULL. 2011-09-04 18:38:42 -07:00
Peter Bright
e1af07e831 Open files with sharing enabled. Fixes node's issue #1449.
https://github.com/joyent/node/issues/1449
2011-09-04 18:37:28 -07:00
Peter Bright
7db243dc6f Bring inline with node common.gypi.
Win32 readlink()
2011-09-04 13:24:45 -07:00
Igor Zinkovsky
060026ced3 windows: uv_fs_link + uv_fs_symlink 2011-09-04 13:24:35 -07:00
Igor Zinkovsky
cf5ed86a79 windows: implement missing fs functions 2011-09-03 12:23:27 -07:00
Igor Zinkovsky
22197ebf3f windows: include _stat struct into uv_fs_t 2011-09-01 11:54:43 -07:00