Comparing version 0.2.0 to 0.2.1
@@ -22,3 +22,5 @@ // Permission is hereby granted, free of charge, to any person obtaining a | ||
var fs = require('fs'); | ||
var constants = require('constants'); | ||
// populate with fs functions | ||
for (var key in fs) { | ||
@@ -28,2 +30,9 @@ exports[key] = fs[key]; | ||
// put constants into constants module (don't like doing this but...) | ||
for (var key in binding) { | ||
if (/^[A-Z_]+$/.test(key)) { | ||
constants[key] = binding[key]; | ||
} | ||
} | ||
// Used by flock | ||
@@ -75,1 +84,13 @@ function stringToFlockFlags(flag) { | ||
exports.seek = function(fd, position, whence, callback) { | ||
callback = arguments[arguments.length - 1]; | ||
if (typeof(callback) !== 'function') { | ||
callback = noop; | ||
} | ||
binding.seek(fd, position, whence, callback); | ||
} | ||
exports.seekSync = function(fd, position, whence) { | ||
return binding.seek(fd, position, whence); | ||
} |
@@ -6,3 +6,3 @@ { | ||
"keywords": ["fs", "filesystem", "flock", "seek"], | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"homepage": "https://github.com/baudehlo/node-fs-ext/", | ||
@@ -9,0 +9,0 @@ "repository": { |
@@ -40,1 +40,14 @@ fs-ext | ||
Synchronous flock(2). Throws an exception on error. | ||
### fs.seek(fd, offset, whence, [callback]) | ||
Asynchronous lseek(2). No arguments other than a possible error are passed to | ||
the callback. `whence` can be 0 (SEEK_SET) to set the new position in bytes | ||
to `offset`, 1 (SEEK_CUR) to set the new position to the current position | ||
plus `offset` bytes (can be negative), or 2 (SEEK_END) to set to the end | ||
of the file plus `offset` bytes (usually negative or zero to seek to the end | ||
of the file). | ||
### fs.seekSync(fd, offset, whence) | ||
Synchronous lseek(2). Throws an exception on error. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11478
75
53