question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

rename() should work for folders

See original GitHub issue

When running .rename() on a folder, it is expected to rename the folder, and update all file paths in that folder.

But, actually there is no effect. 😦

const {vol} = require('memfs')
vol.mkdirSync('/a');
vol.writeFileSync('/a/a.txt', 'hello');
console.log(vol.toJSON()) // {a/a.txt: "hello"}
vol.renameSync('/a/', '/b/')
console.log(vol.toJSON()) // {/a/a.txt: "hello"}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ronakjcommented, Dec 22, 2021

Just encountered this issue with my tests. Thanks for the fix @jorenbroekema 💯.

0reactions
streamichcommented, Dec 30, 2021

🎉 This issue has been resolved in version 3.4.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Change or Rename a File, Folder, or Directory
Method four · Highlight the file or folder. · Once highlighted, wait a few seconds and click the file name again. A box...
Read more >
Rename a file, folder, or link in a document library
Learn how to rename a file, folder, or link in a SharePoint document library.
Read more >
Rename a file or folder
As with other file managers, you can use Files to change the name of a file or folder. To rename a file or...
Read more >
Renaming files and directories with the same pattern in R
Ok, so I used basename(tbl) to access only the files as I see file.rename doesn't rename directories. So for now if we forget...
Read more >
How To Rename a Directory on Linux - devconnected
To rename this directory, you would use the “mv” command and specify the two directory names. $ mv /home/user/temp /home/user/directory. Note : ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found