profile
viewpoint
Mani Maghsoudlou manidlou California full stack dev, collaborator at node-fs-extra &-> mind explorer.

issue closedmanidlou/node-klaw-sync

Confusing description of traverseAll default value

Package version: 6.0.0

The README reads:

  • traverseAll <Boolean> default: true
    • traverse all subdirectories, regardless of filter option. (When set to true, traverseAll produces similar behavior to the default behavior prior to v4.0.0. The current default of traverseAll: false is equivalent to the old noRecurseOnFailedFilter: true).

First, it says it's true by default.

Then it says "The current default of traverseAll: false" implicating it's false by default.

In the code it is in fact undefined, which is equivalent to false in this case.

If the parameter is not present, klaw-sync behaves as if it was false.

What is the intended default value of this parameter, true or false? true seems more reasonable to me, but regardless, I believe default value should be indicated clearly in the docs and correspond to the actual behavior.

I also find it confusing that sister module node-klaw does not have this option at all.

closed time in a month

l1bbcsg

issue commentmanidlou/node-klaw-sync

Confusing description of traverseAll default value

Closed via https://github.com/manidlou/node-klaw-sync/commit/bc081f0b46a2795e59c88f758b5c46cc1bfe06dd

l1bbcsg

comment created time in a month

push eventmanidlou/node-klaw-sync

Mani Maghsoudlou

commit sha bc081f0b46a2795e59c88f758b5c46cc1bfe06dd

update docs

view details

push time in a month

Pull request review commentjprichardson/node-fs-extra

Update dest atime after copy/copy-sync

 function copyFileFallback (srcStat, src, dest, opts) {     pos += bytesRead   } -  if (opts.preserveTimestamps) fs.futimesSync(fdw, srcStat.atime, srcStat.mtime)+  if (opts.preserveTimestamps) {+    const updatedSrcStat = fs.statSync(src)+    fs.futimesSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime)+  } 

Also I just realized we forgot to chmod again here before closing fds. copy does that and we need to be consistent. So I think it is better we have the same function setDestModeAndTimestamps() like in copy so that we can call it after both native copy and fallback.

mbargiel

comment created time in a month

Pull request review commentjprichardson/node-fs-extra

Update dest atime after copy/copy-sync

 function copyFileFallback (srcStat, src, dest, opts, cb) {     const ws = fs.createWriteStream(dest, { mode: srcStat.mode })     ws.on('error', err => cb(err))       .on('open', () => rs.pipe(ws))-      .once('close', () => setDestModeAndTimestamps(srcStat, dest, opts, cb))+      .once('close', () => setDestModeAndTimestamps(srcStat, src, dest, opts, cb))   }) } -function setDestModeAndTimestamps (srcStat, dest, opts, cb) {-  fs.chmod(dest, srcStat.mode, err => {+function setDestModeAndTimestamps (srcStat, src, dest, opts, cb) {+  if (!opts.preserveTimestamps) {+    return fs.chmod(dest, srcStat.mode, cb)+  }++  const next = (err) => {     if (err) return cb(err)-    if (opts.preserveTimestamps) {-      return utimes(dest, srcStat.atime, srcStat.mtime, cb)-    }-    return cb()-  })+    // Cannot rely on previously fetched srcStat because atime is updated by+    // the read operation: https://nodejs.org/docs/latest-v8.x/api/fs.html#fs_stat_time_values+    return fs.stat(src, (err, srcStat) => {+      if (err) return cb(err)+      return utimes(dest, srcStat.atime, srcStat.mtime, (err) => {+        if (err) return cb(err)+        return fs.chmod(dest, srcStat.mode, cb)+      })+    })+  }++  if ((srcStat.mode & 0o200) === 0) {+    // Make sure the file is writable first+    return fs.chmod(dest, srcStat.mode | 0o200, next)

This doesn't seem required! also this is a little hard to read. I think that'd be better we just run the functions without creating another inner function.

mbargiel

comment created time in a month

Pull request review commentjprichardson/node-fs-extra

Update dest atime after copy/copy-sync

 function copyFileFallback (srcStat, src, dest, opts) {     pos += bytesRead   } -  if (opts.preserveTimestamps) fs.futimesSync(fdw, srcStat.atime, srcStat.mtime)+  if (opts.preserveTimestamps) {+    const updatedSrcStat = fs.statSync(src)+    fs.futimesSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime)

fs.futimesSync() should use fdw and not dest.

mbargiel

comment created time in a month

Pull request review commentjprichardson/node-fs-extra

Update dest atime after copy/copy-sync

 function mayCopyFile (srcStat, src, dest, opts) { function copyFile (srcStat, src, dest, opts) {   if (typeof fs.copyFileSync === 'function') {     fs.copyFileSync(src, dest)-    fs.chmodSync(dest, srcStat.mode)     if (opts.preserveTimestamps) {-      return utimesSync(dest, srcStat.atime, srcStat.mtime)+      // Make sure the file is writable first+      if ((srcStat.mode & 0o200) === 0) {+        fs.chmodSync(dest, srcStat.mode | 0o200)

This seems unnecessary! we are chmoding dest at the end anyway.

mbargiel

comment created time in a month

pull request commentisaacs/node-graceful-fs

Support stat options argument

@ZauberNerd thank you for your PR. I appreciate the effort! I am not a maintainer of this repo but I quickly looked at the code and LGTM! :+1:

ZauberNerd

comment created time in a month

issue commentjprichardson/node-fs-extra

fs.move folder report EPERM error

Looking at the provided travis log, EPERM error comes from rename and the only thing that is changed in the internal rename function of move from fs-extra 7.0.1 to 8.0.1 is that we use native fs instead of graceful-fs temporarily (#664). My gut tells me once we switch back to graceful-fs this will be resolved. Basically, this is one of the reasons (advantages) that we use graceful-fs as a dependency so that we don't need to do extra work for cases like this here in our codebase!

fpsqdb

comment created time in a month

issue commentjprichardson/node-fs-extra

fs.move folder report EPERM error

Another thing is I am wondering if it happens outside of electron as well! Has anyone been experiencing this in environments other than electron?

fpsqdb

comment created time in a month

issue commentmanidlou/node-klaw-sync

depthLimit option is ignored when filter option is set

@Lukas238 if I understand correctly, you have a directory structure like /2016/01.January (/year/month) under /Users/user1/work as root directory.

By examining your example and looking at your regex link results, seems like klawSync behaves correctly because paths like /Users/user1/work/2016 don't match your regex! Although paths like /Users/user1/work/2016/01.January do match your regex but these are subfolders and they never get traversed because their parent folders don't match the regex!

Lukas238

comment created time in a month

issue commentmanidlou/node-klaw-sync

Confusing description of traverseAll default value

@l1bbcsg I agree the docs is not clear about traverseAll option. The default value for traverseAll is true. I will update the docs. Also, we figured this is a good approach to handle reading directories recursively while supporting filter option.

For node-klaw, we still need to so something about it! there are ongoing discussions on node-klaw repo.

https://github.com/jprichardson/node-klaw/issues/11 https://github.com/jprichardson/node-klaw/issues/17

l1bbcsg

comment created time in a month

pull request commentjprichardson/node-fs-extra

Clarify `remove` semantics

@wmertens I agree with @RyanZim that we need to test the null and undefined value if we want to add it to the docs.

would have conveyed the message that there's no error if the file is nonexistent, but I suppose it wouldn't hurt to explicitly mention that. :+1:

I agree with that too! I believe that's a good idea to explicitly mention that in the docs.

wmertens

comment created time in a month

issue commentjprichardson/node-fs-extra

fs.move folder report EPERM error

Also could be because we disabled graceful-fs (#664) and switched to native fs as graceful-fs needs to be updated. Basically, graceful-fs has some improvements over native fs like handling EPERM error on windows when trying to rename a file.

fpsqdb

comment created time in a month

issue commentjprichardson/node-fs-extra

Fs-extra v8, copy function gives error when using with jest

Yeah exactly! If graceful-fs was updated we didn't go through all of this hassle!

vladshcherbin

comment created time in a month

issue commentjprichardson/node-fs-extra

fs.move folder report EPERM error

We added checking paths in v8.0.1 that stats src and dest. Seems like the running process doesn't have permissions to stat the folder! Windows is known to throw EPERM error in different situations!

I am thinking maybe we should remove path checking in move! My primary goal was to be consistent with copy as well as avoiding possible future bugs. But if we believe it is not that needed for move, I am fine removing it! We can take care of the :bug:s once they show up!

fpsqdb

comment created time in a month

issue commentjprichardson/node-fs-extra

Fs-extra v8, copy function gives error when using with jest

wondering if we need to disable that in the fs/index.js until they update their code!

vladshcherbin

comment created time in a month

issue commentjprichardson/node-fs-extra

Fs-extra v8, copy function gives error when using with jest

hmm..! That's so weird! That error basically comes from graceful-fs that we use as a dependency. But we disabled that and used native fs in fs-extra v8.0.1 to use fs.stat() with bigint option.

vladshcherbin

comment created time in a month

issue closedjprichardson/node-fs-extra

Error: Cannot find module './fs.js'

"fs-extra": "^5.0.0", node v11.3.0 webpack v4.30.0 npm v6.4.1

npm install

Error: Cannot find module './fs.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:668:15) at Function.Module._load (internal/modules/cjs/loader.js:591:27) at Module.require (internal/modules/cjs/loader.js:723:19) at require (internal/modules/cjs/helpers.js:14:16) at Object.<anonymous> (/Users/godofdeath/work/weex/logweexmodule/node_modules/graceful-fs/polyfills.js:1:10) at Module._compile (internal/modules/cjs/loader.js:816:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10) at Module.load (internal/modules/cjs/loader.js:685:32) at Function.Module._load (internal/modules/cjs/loader.js:620:12) at Module.require (internal/modules/cjs/loader.js:723:19) npm WARN babel-loader@6.4.1 requires a peer of webpack@1 || 2 || ^2.1.0-beta || ^2.2.0-rc but none is installed.You must install peer dependencies yourself.

closed time in a month

zjh12580

pull request commentjprichardson/node-fs-extra

Clarify `remove` semantics

@wmertens what is the issue exactly? what is confusing?

wmertens

comment created time in a month

PR closed jprichardson/node-fs-extra

make move-sync stronger

when using move-sync, i encounter an "EERROR", which moveSyncAcrossDevice method can handle it well

+1 -1

3 comments

1 changed file

carlsirce

pr closed time in a month

pull request commentjprichardson/node-fs-extra

make move-sync stronger

Closing this as there has been no responses! @carlsirce please open a new PR with the latest master and more clarifying description, if you want us to do something about this! Thank you!

carlsirce

comment created time in a month

Pull request review commentjprichardson/node-fs-extra

Add support for fs.realpath.native in envs that support it

+'use strict'++const fs = require('fs')+const fse = require('../..')+const assert = require('assert')++/* eslint-env mocha */++// fs.realpath.native only available in Node v9.2++if (typeof fs.realpath.native === 'function') {+  describe('realpath.native', () => {+    it('works with callbacks', () => {+      fse.realpath.native(__dirname, (err, path) => {+        assert.ifError(err)+        assert.equal(path, __dirname)

It is better to use assert.strictEqual() since assert.equal() is deprecated in the legacy mode.

RyanZim

comment created time in a month

Pull request review commentjprichardson/node-fs-extra

Add support for fs.realpath.native in envs that support it

+'use strict'++const fs = require('fs')+const fse = require('../..')+const assert = require('assert')++/* eslint-env mocha */++// fs.realpath.native only available in Node v9.2++if (typeof fs.realpath.native === 'function') {+  describe('realpath.native', () => {+    it('works with callbacks', () => {+      fse.realpath.native(__dirname, (err, path) => {+        assert.ifError(err)+        assert.equal(path, __dirname)

It is better to use assert.strictEqual() since assert.equal() is deprecated in the legacy mode.

RyanZim

comment created time in a month

issue closedjprichardson/node-fs-extra

copy and copySync can fail with 'Source and destination must not be the same'

  • Operating System: Windows 10
  • Node.js version: 8.11.3
  • fs-extra version:7.0.0

copy and copySync will fail with 'Source and destination must not be the same' when node occasionally returns the same ino for different files due to a bigint rounding issue (https://github.com/nodejs/node/issues/12115). The solution is probably to set options parameter to { bigint: true } when calling fstat (https://nodejs.org/api/fs.html#fs_fs_fstat_fd_options_callback) from the checkPaths function of copy.js and copy-sync.js.

closed time in a month

bvachon

pull request commentjprichardson/node-fs-extra

Add support for fs.realpath.native in envs that support it

good! so we don't need to do anything for fs.realpathSync.native?

RyanZim

comment created time in a month

pull request commentjprichardson/node-fs-extra

util/stat: fix max call stack size exceeded

@RyanZim I went ahead and published a patch v8.0.1.

manidlou

comment created time in a month

push eventjprichardson/node-fs-extra

Mani Maghsoudlou

commit sha 32a65ffd9111829dbba15d79f1d27519c7dc96a6

8.0.1

view details

push time in a month

pull request commentjprichardson/node-fs-extra

util/stat: fix max call stack size exceeded

@RyanZim the soonest that I can publish a patch is tonight, but if you can do it sooner, that'd be great if you handle that. Thank you!

manidlou

comment created time in a month

delete branch jprichardson/node-fs-extra

delete branch : fix-max-call-stack

delete time in a month

push eventjprichardson/node-fs-extra

Mani Maghsoudlou

commit sha 72278dcf14d839b25b87644bb90a426751368584

util/stat: resolve paths before parsing

view details

Mani Maghsoudlou

commit sha 7c251d6df9cc24cae4c64b207acbed109eff697a

Merge pull request #679 from jprichardson/fix-max-call-stack util/stat: fix max call stack size exceeded

view details

push time in a month

PR merged jprichardson/node-fs-extra

Reviewers
util/stat: fix max call stack size exceeded bug

fixes #678.

  • resolve paths before parsing in util/stat.js
  • add util/stat tests
+86 -7

3 comments

2 changed files

manidlou

pr closed time in a month

issue closedjprichardson/node-fs-extra

[8.0.0] RangeError: Maximum call stack size exceeded at moveSync

<!-- First ensure you installed the latest version of fs-extra --> <!-- If your bug still exists please fill out the following information if it applies to your issue: -->

  • Operating System: Windows [Version 10.0.17763.475]
  • Node.js version: v11.14.0
  • fs-extra version: v8.0.0

In the v7.0.1 is working fine!

// Move
paths.forEach(path => (
  fs.moveSync(`${src}/${path}`, `${dest}${applyConfig(path, config)}`, { overwrite: true })
));

(node:5924) UnhandledPromiseRejectionWarning: RangeError: Maximum call stack size exceeded at isPathSeparator (path.js:38:25) at Object.resolve (path.js:169:13) at Object.toNamespacedPath (path.js:555:32) at Object.statSync (fs.js:869:41) at checkParentPathsSync (C:\Users\johne\Documents\Elaniin Tech Company\elaniin-cli\node_modules\fs-extra\lib\util\stat.js:143:21) at checkParentPathsSync (C:\Users\johne\Documents\Elaniin Tech Company\elaniin-cli\node_modules\fs-extra\lib\util\stat.js:154:10) at checkParentPathsSync (C:\Users\johne\Documents\Elaniin Tech Company\elaniin-cli\node_modules\fs-extra\lib\util\stat.js:154:10) at checkParentPathsSync (C:\Users\johne\Documents\Elaniin Tech Company\elaniin-cli\node_modules\fs-extra\lib\util\stat.js:154:10) at checkParentPathsSync (C:\Users\johne\Documents\Elaniin Tech Company\elaniin-cli\node_modules\fs-extra\lib\util\stat.js:154:10) at checkParentPathsSync (C:\Users\johne\Documents\Elaniin Tech Company\elaniin-cli\node_modules\fs-extra\lib\util\stat.js:154:10) at checkParentPathsSync (C:\Users\johne\Documents\Elaniin Tech Company\elaniin-cli\node_modules\fs-extra\lib\util\stat.js:154:10) at checkParentPathsSync (C:\Users\johne\Documents\Elaniin Tech Company\elaniin-cli\node_modules\fs-extra\lib\util\stat.js:154:10) at checkParentPathsSync (C:\Users\johne\Documents\Elaniin Tech Company\elaniin-cli\node_modules\fs-extra\lib\util\stat.js:154:10) at checkParentPathsSync (C:\Users\johne\Documents\Elaniin Tech Company\elaniin-cli\node_modules\fs-extra\lib\util\stat.js:154:10) at checkParentPathsSync (C:\Users\johne\Documents\Elaniin Tech Company\elaniin-cli\node_modules\fs-extra\lib\util\stat.js:154:10) at checkParentPathsSync (C:\Users\johne\Documents\Elaniin Tech Company\elaniin-cli\node_modules\fs-extra\lib\util\stat.js:154:10)

closed time in a month

williamcruzme

issue commentjprichardson/node-fs-extra

[8.0.0] (node:27451) UnhandledPromiseRejectionWarning: RangeError: Maximum call stack size exceeded

yeah I would say this is the same as #678 and will be fixed with #679. If #679 doesn't fix it, we will dive deeper into that!

marvindanig

comment created time in a month

pull request commentjprichardson/node-fs-extra

util/stat: fix max call stack size exceeded

rebased it. It should be ready now!

manidlou

comment created time in a month

push eventjprichardson/node-fs-extra

Mani Maghsoudlou

commit sha 72278dcf14d839b25b87644bb90a426751368584

util/stat: resolve paths before parsing

view details

push time in a month

pull request commentjprichardson/node-fs-extra

util/stat: fix max call stack size exceeded

@jprichardson @RyanZim @JPeer264 please let me know if you have any concerns regarding this!

manidlou

comment created time in a month

push eventjprichardson/node-fs-extra

Mani Maghsoudlou

commit sha 0600fde6754d9ec3cbd19d27591f6dceaae6eeba

util/stat: consistent style for better readability

view details

push time in a month

push eventjprichardson/node-fs-extra

Mani Maghsoudlou

commit sha 72a0c641c89a7e8c66f97de2470824dac9278b96

util/stat: fix test

view details

push time in a month

push eventjprichardson/node-fs-extra

Mani Maghsoudlou

commit sha 1bd69f779c625a25477b68da755648d0a77dda5d

util/stat: better test description

view details

push time in a month

PR opened jprichardson/node-fs-extra

util/stat: fix max call stack size exceeded

fixes #678.

  • resolve paths before parsing in util/stat.js
  • add util/stat tests
+87 -7

0 comment

2 changed files

pr created time in a month

create barnchjprichardson/node-fs-extra

branch : fix-max-call-stack

created branch time in a month

issue commentjprichardson/node-fs-extra

[8.0.0] RangeError: Maximum call stack size exceeded at moveSync

thanks @efstathiosntonas! I am sure that will help too.

In the meantime, I think I found the bug! I will make PR shortly with a possible fix.

williamcruzme

comment created time in a month

issue commentjprichardson/node-fs-extra

[8.0.0] RangeError: Maximum call stack size exceeded at moveSync

@dumbmatter thanks for your comment. I was able to recreate the issue using your example.

williamcruzme

comment created time in a month

pull request commentjprichardson/node-fs-extra

Should have `fs.realpath*.native()` function

That's right we have to add that! but your PR doesn't add it to the api. You gotta add it to the api array in index.js.

gucong3000

comment created time in a month

issue commentjprichardson/node-fs-extra

[8.0.0] RangeError: Maximum call stack size exceeded at moveSync

Possibly! I am running it on Ubuntu 18.04 and node 10.9.0

williamcruzme

comment created time in a month

issue commentjprichardson/node-fs-extra

[8.0.0] RangeError: Maximum call stack size exceeded at moveSync

@williamcruzme I cannot reproduce the issue by running your example!

williamcruzme

comment created time in a month

issue commentjprichardson/node-fs-extra

[8.0.0] RangeError: Maximum call stack size exceeded at moveSync

Thanks @williamcruzme! I'll take a look.

williamcruzme

comment created time in a month

issue commentjprichardson/node-fs-extra

[8.0.0] RangeError: Maximum call stack size exceeded at moveSync

@williamcruzme @efstathiosntonas can you please provide us a repo test case?

williamcruzme

comment created time in a month

issue commentjprichardson/node-fs-extra

[8.0.0] RangeError: Maximum call stack size exceeded at moveSync

I think one way to fix this is wrapping checkParentPathsSync() recursive call in setTimeout(). Or maybe we could remove checking parent paths from move since i primarily used that to fix copying bind-mounted dirs and move uses copy for cross device operation anyway.

williamcruzme

comment created time in a month

PR closed jprichardson/node-fs-extra

CheckPath Error -> Warn of Inode.

Fixes https://github.com/jprichardson/node-fs-extra/issues/657

The inode number is an integer unique to the volume upon which it is stored. That means, the method checkPaths() disallows me to copy a file from one to another volume. Also fs-extra does not set the big-integer flag of node fs. It's only a "default" JavaScript number (max integer is 53-bit). See the difference here On Windows the cap is reached.

No option provided, because checking if Inode is the wrong way. It's not only a big-integer issue. Inodes are only unique to the volume upon which it is stored.

This will fix the issue #657 I keep it as warning to see it when is happen. Maybe not the best solution. But with the thrown error, it is not possible to use it. Example: It's not possible to stable build with Android-Cordova 8.x. Because Cordova switched to fs-extra since version 8.x.

Better solutions are welcome. But keep in mind that the Inode (state.ino of fs) is not really unique global and in current fs-extra implementation. Again:

  • The inode number is an integer unique to the volume upon which it is stored.
  • state.ino of fs also supports big-integer. Node version 10.4 is required to use this. But currently it's set for number (53-bit) only.

The aim is to remove / replace this check. Because it's faulty. (Inode) You'll get errors from fs / os.

+10 -2

4 comments

2 changed files

Domvel

pr closed time in 2 months

pull request commentjprichardson/node-fs-extra

CheckPath Error -> Warn of Inode.

Closing this as the issue is fixed in fs-extra v8.

Domvel

comment created time in 2 months

pull request commentjprichardson/node-fs-extra

v8 release

@RyanZim you did the right thing! Thanks for taking care of that!

manidlou

comment created time in 2 months

pull request commentjprichardson/node-fs-extra

v8 release

@RyanZim the items from this PR for release notes are correct. Thanks for taking care of that! Also i just saw your comment in the pile of comments! Hope you feel better!

manidlou

comment created time in 2 months

pull request commentjprichardson/node-fs-extra

v8 release

@jprichardson @RyanZim @JPeer264 please let me know if you have any concerns about this :smiley:

manidlou

comment created time in 2 months

push eventjprichardson/node-fs-extra

Mani Maghsoudlou

commit sha c80c36739ec426ca9bcc3529b7300d0f965c3dae

use semver to parse node version in tests

view details

push time in 2 months

push eventjprichardson/node-fs-extra

Mani Maghsoudlou

commit sha 6866691ead6c1d9505df36a9a3442107488a4c41

refactor parsing node version

view details

push time in 2 months

push eventjprichardson/node-fs-extra

Mani Maghsoudlou

commit sha 867596c0e6bbc7bf03e24e7d6d6cff32bf130831

update copy*() docs

view details

push time in 2 months

pull request commentjprichardson/node-fs-extra

v8 release

Alright it should be ready now! updated the description as well! Once it is approved, @RyanZim will you please take care of the changelog and I will do the rest of it :smiley:?

manidlou

comment created time in 2 months

push eventjprichardson/node-fs-extra

Mani Maghsoudlou

commit sha 04be6bc3266b5edb290a9a9107c2c4b5e7456f50

tiny reformat

view details

push time in 2 months

push eventjprichardson/node-fs-extra

Mani Maghsoudlou

commit sha ec208f47fd84a5915924d3cd2fa2e650a6bc9d81

fix parsing node version

view details

push time in 2 months

push eventjprichardson/node-fs-extra

Mani Maghsoudlou

commit sha c8c5002e78f94a5a1fc0cd4cc3939e0a002dd3f3

disable graceful-fs in copy and move tests

view details

push time in 2 months

push eventjprichardson/node-fs-extra

Mani Maghsoudlou

commit sha 19eabe1b638e9b719d679d728f8333168e04fe15

copy*(): use fs.stat with bigint option

view details

Mani Maghsoudlou

commit sha ac57df7e4e47adc8178c120970dfad3b08233255

move*(): refactor to use the internal stat functions

view details

Mani Maghsoudlou

commit sha ffe29995eebd7bc305c7d096880c4b9c1b0f9e19

move*(): add test for prevent moving identical

view details

push time in 2 months

issue commentjprichardson/node-fs-extra

fs.stat() with options doesn't work on graceful-fs

yes @brodybits

manidlou

comment created time in 2 months

pull request commentjprichardson/node-fs-extra

v8 release

@Domvel we are very well aware of the issue. As I mentioned in the description, we use graceful-fs as a dependency and unfortunately it still doesn't support bigint option! Although I opened an issue there but they have been unresponsive so far!

Honestly I've been thinking about this a lot for awhile and I personally like to fix this right and the only reason that I went down the road of adding the checkPathsBeforeCopying option as a workaround, was that graceful-fs doesn't support the bigint yet! I personally believe copy should be able to handle this cases internally without any extra options. The way that I prefer to fix this is by using the bigint option for node versions that support it and fallback to the legacy approach.

So @jprichardson @RyanZim @JPeer264 although I myself worked on this workaround, this is how I suggest to handle this:

  • disable graceful-fs for now and switch to the built-in fs so that we have the fs.stat() with bigint option available in node versions >= 10.5.0. We will switch back to the graceful-fs once the upstream update their code.
  • use fs.stat() with bigint for node versions that support it and use old fs.stat() for older versions.

Also @Domvel copy will continue work across devices since I will implement the fix in a way that we only throw source and destination are the same error if src and dest have the same inode and they exist on the same device.

manidlou

comment created time in 2 months

issue commentjprichardson/node-fs-extra

Error: Cannot find module './fs.js'

Seems like your environment is browser. fs-extra doesn't work on browsers.

zjh12580

comment created time in 2 months

startedgreena13/react-hotkeys

started time in 2 months

push eventjprichardson/node-fs-extra

Mani Maghsoudlou

commit sha bb30e7f1758c0388a8e4cddb48752e83bcb85e8b

some reformatting

view details

push time in 3 months

pull request commentjprichardson/node-fs-extra

v8 release

fixed the commits!

manidlou

comment created time in 3 months

push eventjprichardson/node-fs-extra

Mani Maghsoudlou

commit sha a0bb74f4ce61e2563f72563818cc0fdc5545d452

Remove secure-random from dev-deps (#610)

view details

Mani Maghsoudlou

commit sha 7701ef2406b9ec5162a4d72ccca407fd8d873419

fix ensureDir() doc

view details

Mani Maghsoudlou

commit sha e85799d0955f5c65ce1bb0ed28042ece54f945b5

moveSync: refactor to use renameSync

view details

Mani Maghsoudlou

commit sha 5116248b6ac1314c98edba03b40417b7a5ecbdf1

copy*(): fix copying bind-mounted directories (#618) * copy*(): fix copying bind-mounted dirs * copy*(): fix case-insensitive-paths tests * copy*(): refactor to check paths more efficiently * destructure stats object after checking err

view details

Mani Maghsoudlou

commit sha f9e25195f302e00499490ef7b3a99d44b5962abb

move*(): check paths before moving

view details

Mani Maghsoudlou

commit sha 5ea17f2336fc762603477d84aabbba353c808428

move*(): add case-insensitive paths test

view details

Mani Maghsoudlou

commit sha 7513e2671c9a66240e1ec36caf47ae21feb87a66

remove unnecessary done callback from test

view details

Mani Maghsoudlou

commit sha 0c30f8c1e23a52af5be38d5a21bd788987b4b420

copy*(): add new option checkPathsBeforeCopying

view details

Mani Maghsoudlou

commit sha 033d7cf8ec1ab67ee083323bb8b6fd82e3db785c

update copy*() docs to include checkPathsBeforeCopying

view details

push time in 3 months

pull request commentjprichardson/node-fs-extra

v8 release

@RyanZim yeah i know! I will fix it for sure!

manidlou

comment created time in 3 months

pull request commentjprichardson/node-fs-extra

v8 release

I will rebase this!

manidlou

comment created time in 3 months

pull request commentjprichardson/node-fs-extra

v8 release

It is already rebased.

manidlou

comment created time in 3 months

push eventjprichardson/node-fs-extra

Mani Maghsoudlou

commit sha 30a1dea1b16eb8a6891c41a68c3ba1c54b423760

update copy*() docs to include checkPathsBeforeCopying

view details

push time in 3 months

PR opened jprichardson/node-fs-extra

v8 release

I think it is time to release v8. @jprichardson @RyanZim @JPeer264 please let me know if you think differently!

graceful-fs has not been updated yet to support bigint option. I opened an issue there, but there has been no responses yet! So we'll update once the upstream is updated.

So, I figured for now, the quickest way to fix #657 is by adding a new option { checkPathsBeforeCopying: true|false } to copy*() to let users decide if they want us to check paths or not. This is to make windows users happy again until we figure this out properly!

WARNING FOR USERS: since overwrite is true by default, be careful when using { checkPathsBeforeCopying: false } since you may end up losing your source file! see #565 as an example.

Also, removed standard-markdown as it started giving us more headaches than benefits!

+1797 -468

0 comment

48 changed files

pr created time in 3 months

push eventjprichardson/node-fs-extra

Alexander Lewitt

commit sha 287f234817871976f80e28ab50b339471e4c4223

Fix typo in docs (#628)

view details

Austin Gordon

commit sha ab254b1efdefe0b05f73e96fb3f1d17902e03942

Added docs/ and CHANGELOG.md to .npmignore (#642) (#643) These files are not necessary. Closes #642

view details

Pete Gonzalez

commit sha ddc1a2f9d42da77342d58f6fd86942a231f5f27f

Fix removeSync() to eliminate spurious ENOTEMPTY errors on Windows (#646) Fix removeSync() to measure its retry interval in milliseconds instead of CPU cycles

view details

Ryan Zimmerman

commit sha 639291769eff8c57d47147d8426bdd26ed9429b6

Temporarily disable standard-markdown

view details

Ryan Zimmerman

commit sha a32c85282185aa008759890cce059594e4348262

7.0.1

view details

Steve Moser

commit sha 8e0879110fbdd597c36602fe3b81ef03a4b3ec7a

Remove --save option as it isn't required anymore (#660)

view details

Mani Maghsoudlou

commit sha a6787566af8fb4b5d0d391a77d62b958b229cc8c

Remove secure-random from dev-deps (#610)

view details

Mani Maghsoudlou

commit sha f847d0b79a9f2189bbdd04a5822677e2a290f6aa

docs: refactor to be consistent with node docs (#611)

view details

Mani Maghsoudlou

commit sha db09339cbe5e4237a42068044244b506709cc5d5

moveSync: refactor to use renameSync

view details

Mani Maghsoudlou

commit sha e3838c25cf192e2933b22ffc47c12f03c0af8fd1

copy*(): fix copying bind-mounted directories (#618) * copy*(): fix copying bind-mounted dirs * copy*(): fix case-insensitive-paths tests * copy*(): refactor to check paths more efficiently * destructure stats object after checking err

view details

Mani Maghsoudlou

commit sha 69cd600343ae896cf21cc03ab9cb2b97d9f348c9

move*(): check paths before moving

view details

Mani Maghsoudlou

commit sha fab5c2722856d0b0a33c6a3b6dffdde781711ca7

move*(): add case-insensitive paths test

view details

Mani Maghsoudlou

commit sha 7d324ce49facf864c9f4e21ec26196dbbffe0015

remove unnecessary done callback from test

view details

Mani Maghsoudlou

commit sha 562902f9578a8150efce2abb70aa15227cbe96a6

Merge branch 'v8-dev' of github.com:jprichardson/node-fs-extra into v8-dev

view details

Mani Maghsoudlou

commit sha 3d24bbf53fffc236f3bfa1affca716e2d979f429

copy*(): add new option checkPathsBeforeCopying

view details

push time in 3 months

issue openedjprichardson/node-fs-extra

fs.stat() with option doesn't work on graceful-fs

I was working on fixing the inode bug and noticed that apparently graceful-fs hasn't been updated yet to support fs.stat() with additional options object. I tried with the latest version v4.1.15 also and still no success! I opened an issue there: https://github.com/isaacs/node-graceful-fs/issues/158.

created time in 3 months

issue openedisaacs/node-graceful-fs

fs.stat() with options doesn't work

fs.stat() and its relatives accept an additional options object fs.stat(path[, options], callback) since node v10.5.0.

https://nodejs.org/api/fs.html#fs_fs_stat_path_options_callback

seems like graceful-fs hasn't been updated yet! This will cause issues for projects that depend on graceful-fs. I am one of the maintainers of fs-extra and this prevents us from using fs.stat() with bigint option!

created time in 3 months

more