Fedor Indutny
2f54947b72
fs: fix readdir on empty directory
...
`uv_fd_readdir()` should initialize all fields even if there are no
files. Fix the implementation and fix the test that should have been
covered it.
2014-09-23 21:06:54 +04:00
Saúl Ibarra Corretgé
df8ab507a0
fs: extend reported types in uv_fs_readdir_next
...
Support all possible types on Unix, and files, directories and links on
Windows. Some systems (hello SunOS!) don't have the d_type field on struct
dirent, so mark them as UV_DIRENT_UNKNOWN.
2014-08-15 16:44:44 +02:00
Fedor Indutny
ab2c4425a5
fs: introduce uv_readdir_next() and report types
...
Introduce:
int uv_fs_readdir_next(uv_fs_t* req, uv_dirent_t* ent);
`uv_fs_readdir()` is not returning a file names list in `req->ptr`
anymore, the proper way to gather them is to call `uv_fs_readdir_next()`
in a callback.
2014-08-14 17:19:45 +04:00
Pavel Platto
e99b89f2ad
unix, windows: add uv_fs_mkdtemp
2014-07-31 09:43:55 +02:00
Andrew Low
cdc979dbe0
aix: improve AIX compatibility
2014-07-22 22:57:24 +02:00
Saúl Ibarra Corretgé
218f48ae56
build: fix compilation warning on MinGW-w64
2014-06-19 23:25:43 +02:00
Saúl Ibarra Corretgé
422d2810b3
unix, windows: make uv_cwd be consistent with uv_exepath
...
Fixes #446
2014-02-27 09:44:28 +01:00
Saúl Ibarra Corretgé
3a8767e35e
unix: fix uv_fs_write when using an empty buffer
2014-02-26 23:59:29 +01:00
Benjamin Saunders
13dd3502a7
fs: vectored IO API for filesystem read/write
...
This improves API consistency with uv_read and uv_write and may
improve efficiency for some uses. Vectored IO is emulated when the
requisite system calls are unavailable.
2014-02-23 17:24:05 +01:00
Fedor Indutny
a03ea239db
Revert "fs: vectored IO API for filesystem read/write"
...
This reverts commit 7df24583e5 .
2014-02-18 21:48:13 +04:00
Benjamin Saunders
7df24583e5
fs: vectored IO API for filesystem read/write
...
This improves API consistency with uv_read and uv_write and may
improve efficiency for some uses. Vectored IO is emulated when the
requisite system calls are unavailable.
2014-02-18 12:30:20 +04:00
Ben Noordhuis
f5baf210df
test: wrap long lines at 80 columns
2013-09-11 17:29:43 +02:00
Ben Noordhuis
4ce3a312aa
test: fix signed/unsigned comparison warnings
2013-07-25 11:25:53 +02:00
Ben Noordhuis
3ee4d3f183
unix, windows: return error codes directly
...
This commit changes the libuv API to return error codes directly rather
than storing them in a loop-global field.
A code snippet like this one:
if (uv_foo(loop) < 0) {
uv_err_t err = uv_last_error(loop);
fprintf(stderr, "%s\n", uv_strerror(err));
}
Should be rewritten like this:
int err = uv_foo(loop);
if (err < 0)
fprintf(stderr, "%s\n", uv_strerror(err));
The rationale for this change is that it should make creating bindings
for other languages a lot easier: dealing with struct return values is
painful with most FFIs and often downright buggy.
2013-07-07 09:51:00 +02:00
Ben Noordhuis
d0be852cb1
test: fix fs_chown when running as root
...
chown(2) to root is expected to fail - unless you're root, of course.
2013-07-02 13:39:28 +02:00
Ben Noordhuis
d4f6165346
test: fix fs_fstat test on sunos
...
The tests are no longer compiled with -D_XOPEN_SOURCE=500 when building
with autotools. Tell the test explicitly that SunOS systems are
expected to have nanosecond fstat(2) granularity.
2013-07-02 13:34:19 +02:00
Saúl Ibarra Corretgé
f9e6029b82
unix, windows: add extra fields to uv_stat_t
2013-06-28 00:42:37 +02:00
Ben Noordhuis
ede83188f3
test: don't use S_IREAD and S_IWRITE
...
They're BSD-isms and obsolete ones at that. Replace with S_IRUSR and
S_IWUSR. Alias as _S_IREAD and _S_IWRITE on Windows because the '90s
never ended in Redmond, WA.
2013-05-31 12:50:19 +02:00
Timothy J Fontaine
499c7976c6
unix, windows: nanosecond resolution for uv_fs_[fl]stat
...
Closes #739 .
2013-03-19 21:48:15 +01:00
Ben Noordhuis
da71649991
unix, windows: make uv_fs_t.statbuf public
...
Make the statbuf field public. This means you no longer have to use
req->ptr - though that still works and will continue to work for the
foreseeable future.
Fixes #704 .
2013-02-10 17:50:03 +01:00
Ben Noordhuis
4ba03ddd56
unix, windows: rename uv_run2 to uv_run
...
This changes the prototype of uv_run() from:
int uv_run(uv_loop_t* loop);
To:
int uv_run(uv_loop_t* loop, uv_run_mode mode);
Where `mode` is UV_RUN_DEFAULT, UV_RUN_ONCE or UV_RUN_NOWAIT.
Fixes #683 .
2013-01-16 23:35:29 +01:00
Ben Noordhuis
847182cdf1
test, bench: make functions/variables static
...
Make functions and variables that are local to the compilation unit
static. Remove what turns out to be unused.
2013-01-06 22:31:48 +01:00
Bert Belder
47eb03490a
test: move loop cleanup code to the individual tests
2012-10-17 01:24:49 +02:00
Ben Noordhuis
e474a2a420
test: fix memory leak in test-fs.c
2012-10-02 23:10:59 +02:00
Ben Noordhuis
8399cb1fc3
test: fix memory leaks in fs_symlink test
2012-10-01 23:54:34 +02:00
Ben Noordhuis
7320633c4b
unix: remove uv_fs_stat windows compat hack
...
uv_fs_stat and uv_fs_lstat removed the trailing backslash (if any) from the path
in order to please a test case that was written for Windows. Remove the
compatibility hack and fix the test.
2012-10-01 22:53:59 +02:00
Ben Noordhuis
1923abda94
test: add uv_fs_readlink test
2012-10-01 22:53:59 +02:00
Andrew Paprocki
900ad30b43
aix: add initial platform support for aix using gcc/gxlc
...
Adds initial libuv build/platform support for AIX. Builds work using gcc or the
IBM XL C compiler using its gxlc wrapper. Platform support is added for
uv_hrtime, uv_exepath, uv_get_free_memory, uv_get_total_memory, uv_loadavg,
uv_uptime, uv_cpu_info, uv_interface_addresses.
2012-09-14 01:23:28 +02:00
saghul
431d61af31
win: map ERROR_PRIVILEGE_NOT_HELD to UV_EPERM
2012-06-25 16:37:08 +02:00
Ben Noordhuis
b19a713cfc
test: fix unused variable warning
2012-05-23 12:51:15 +02:00
Igor Zinkovsky
ea8fa31fc0
fix fs_symlink_dir test
2012-05-22 00:23:26 -07:00
Igor Zinkovsky
60af28abab
windows: support junctions with uv_fs_synlink
...
based on @piscisaureus implementation
2012-05-17 09:53:26 -07:00
Bert Belder
e99fba47c8
Merge remote-tracking branch 'origin/v0.6'
...
Conflicts:
src/win/pipe.c
test/run-tests.c
2012-03-09 16:41:12 +01:00
Bert Belder
abc4f56ff0
Test chown_root: make it pass on windows
2012-03-09 16:31:11 +01:00
Bert Belder
87752ac38b
Fold trailing whitespace
2012-03-09 05:00:09 +01:00
Brandon Philips
d07f2466d0
test: fs: add tests for read EOF
...
This fix was merged without tests:
https://github.com/philips/libuv/tree/fix-read-on-windows-to-handle-eof
So take tests from igorzi:
46024bf33d
2012-03-07 14:33:33 +01:00
Ben Noordhuis
4240f0d710
test: check uv_fs_*() return values
2012-02-23 05:43:21 -08:00
Bert Belder
bc8b99097a
win: add ERROR_FILENAME_EXCED_RANGE mapping, fix fs_file_nametoolong test
2012-02-13 20:01:36 +01:00
Igor Zinkovsky
53eb9935cb
fix windows build
2012-02-09 13:15:37 -08:00
Maciej Małecki
0596c59bc3
test: test if UV_ELOOP mapping works
2012-02-03 22:20:14 +01:00
Bert Belder
267e75dda2
Windows: better stat implementation
2012-02-02 17:03:40 +01:00
Brandon Philips
4cfda74de4
uv.h: add EPERM to errno map to fix regression
...
EPERM isn't mapped in so chown returns an unknown error. This is a
regression from 0.4.12.
philips:node/ (master*) $ cat chown.js
var fs = require('fs')
fs.chown("/tmp/foobar", 100, 100, function(er){ console.log(er);})
philips:node/ (master*) $ ls -la /tmp/foobar
total 0
drwxr-xr-x 2 root wheel 68 Jan 24 17:21 .
0.4
---
philips:node/ (master*) $ /usr/local/Cellar/node/0.4.12/bin/node chown.js
{ stack: [Getter/Setter],
arguments: undefined,
type: undefined,
message: 'EPERM, Operation not permitted \'/tmp/foobar\'',
errno: 1,
code: 'EPERM',
path: '/tmp/foobar' }
master
------
philips:node/ (master*) $ ./node chown.js
{ [Error: UNKNOWN, unknown error '/tmp/foobar'] errno: -1, code: 'UNKNOWN', path: '/tmp/foobar' }
AFTER
-----
philips:node/ (master*) $ ./node chown.js
{ [Error: EPERM, operation not permitted '/tmp/foobar'] errno: 49, code: 'EPERM', path: '/tmp/foobar' }
2012-01-31 16:37:26 -08:00
Ben Noordhuis
f9b478cfd8
test: add windows-only uv_fs_stat regression test
2012-01-28 16:52:46 +01:00
Ben Noordhuis
3f1bad2050
test: add missing return statement in fs_stat_root
2012-01-27 22:10:20 +01:00
Bert Belder
92b260c065
windows: fix stat("c:\\") regression
2012-01-27 22:09:55 +01:00
Bert Belder
f9252750e7
Fix windows build
2012-01-27 16:29:57 +01:00
Maciej Małecki
24e6c7ec86
unix: map ENAMETOOLONG to UV_ENAMETOOLONG
...
With tests. Closes #295
2012-01-23 19:33:09 +01: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
Bruce Mitchener
d513d9bb41
Fix typos.
2011-11-30 14:35:13 +01:00
Ben Noordhuis
c468e2ab88
test: fix memory buffer comparison
2011-11-05 03:09:12 +01:00
Ben Noordhuis
9dc67f5e61
test: don't use _O_RDWR, windows-ism
2011-11-05 03:07:36 +01:00
Igor Zinkovsky
fe97c4dc63
windows: honor O_APPEND in uv_fs_open
2011-11-04 12:41:23 -07:00
Igor Zinkovsky
2216d38c29
windows: enable uv_fs_open to open directories
2011-10-12 10:42:41 -07:00
Ben Noordhuis
25a177a2e5
test: assert that readdir on file raises UV_ENOTDIR
2011-10-12 16:43:33 +02:00
Ben Noordhuis
41e8574920
unix: don't alloc memory for readdir on empty dir
2011-10-10 16:27:55 +02:00
Ben Noordhuis
04b356ab37
test: fix compiler warnings
2011-10-10 16:07:46 +02:00
Igor Zinkovsky
0364809fb5
fix fs_utime & fs_futime tests on windows
2011-10-06 16:25:59 -07:00
Ben Noordhuis
6221904013
sunos: fix gyp build
2011-10-02 00:14:44 +00: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
Ben Noordhuis
2dae0c9e49
test: remove futimes sub-second precision checks, unreliable on freebsd
2011-08-17 07:02:00 +02:00
Igor Zinkovsky
65c8a727a3
uv_fs_ functions to return result in sync mode
2011-09-14 11:47:49 -07:00
Bert Belder
0dc564a2aa
Remove uv_init calls from tests and benchmarks
2011-09-12 11:32:41 -07:00
Igor Zinkovsky
cfa1423f96
fix fs_file_noent on windows
2011-09-08 18:23:19 -07:00
Bert Belder
2d1c672e2d
More MinGW fixes
2011-09-08 23:49:46 +02:00
Erick Tryzelaar
1a43429774
Fix test-fs.c for darwin.
2011-09-08 14:22:08 -07:00
Ben Noordhuis
5641503ae7
test: fix compiler warnings for test-fs.c
...
Include <unistd.h> on Unices, fixes warnings about unlink() not being declared.
2011-09-08 00:15:07 +02:00
Ben Noordhuis
e8ab5cbe70
test: fix utime and futime tests on windows
2011-09-06 03:48:09 +02:00
Ben Noordhuis
79d9f81881
unix: implement uv_fs_futime, add tests for uv_fs_utime and uv_fs_futime
2011-09-06 02:52:52 +02:00
Ben Noordhuis
b7d88070d8
fs: add UV_ENOENT error code, add test
2011-09-06 00:17:59 +02:00
Igor Zinkovsky
a8017fd8a2
windows: update uv_fs_* functions to work with req.path
2011-09-04 23:58:31 -07:00
Ryan Dahl
a18860aec6
Add uv_fs_t.path on unix and tests
...
Windows implementation missing https://github.com/joyent/libuv/issues/177
2011-09-04 18:05:11 -07:00
Ryan Dahl
7ccc7470e0
Add test for uv_fs_readdir sync
2011-09-04 16:54:27 -07:00
Ryan Dahl
142a70292b
unix: fix fs_chmod
2011-09-04 16:09:45 -07:00
Ben Noordhuis
826db45343
test: fix uv_fs_readdir test
...
Don't make assumptions about the order in which the
directory entries are returned by the file system.
2011-09-05 00:57:23 +02: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
Ryan Dahl
9f932f92cf
add test fs_chmod, implement uv_fs_fchmod and uv_fs_chmod on unix
2011-09-01 15:36:01 -07:00
Ryan Dahl
2e6035895c
Add test for uv_fs_fstat, implement on unix.
2011-09-01 14:15:06 -07:00
Igor Zinkovsky
22197ebf3f
windows: include _stat struct into uv_fs_t
2011-09-01 11:54:43 -07:00
Bert Belder
8e3a8602ad
update tests for multiplicity
2011-08-31 04:19:26 +02:00
Ryan Dahl
a6ed1757ab
unix: implement uv_fs_lstat
2011-08-30 01:32:53 -07:00
Ryan Dahl
d20233c7a8
Fix long lines
2011-08-30 00:54:59 -07:00
Ryan Dahl
894c005c42
unix: fix fs_async_sendfile
2011-08-30 00:52:43 -07:00
Ryan Dahl
0e81406bfb
unix fs_async_dir works
2011-08-29 22:08:51 -07:00
Ryan Dahl
cf08c168ea
Use Windows compatibile flags
2011-08-29 20:50:12 -07:00
Ryan Dahl
5d524fff1a
unix passes test fs_file_async
2011-08-29 20:41:45 -07:00
Ryan Dahl
7cad73aa47
Fix build for UNIX
2011-08-26 11:26:24 -07:00
Igor Zinkovsky
25175c7071
uv_fs & uv_work APIs
2011-08-26 11:00:53 -07:00