node-mv icon indicating copy to clipboard operation
node-mv copied to clipboard

not possible to move files in Windows (v7)

Open miukki opened this issue 11 years ago • 4 comments

mv(path.resolve('..', 'file'), path.resolve('..', 'empty1'), function(err){console.log(err)}) Error {errno: 50, code: "EPERM", path: "C:\miukki\file"}

miukki avatar Jan 22 '14 15:01 miukki

I'm seeing this too.

justinbmeyer avatar Aug 29 '15 03:08 justinbmeyer

oh nooo :(

pablomaurer avatar Oct 14 '15 12:10 pablomaurer

the same error in windows 7

        const str = fs.createReadStream(path, 'utf8')
          .pipe(replaceStream(makeRegex ,replaceFn.bind(this, replaceObj), {maxMatchLen: 5000}))
          
        const tempPath = await tempWrite(str)
        await promiseMv(tempPath, path)

function promiseMv(sourceFile, destFile) {
  return new Promise((res, rej) => {
    mv(sourceFile, destFile, {mkdirp: true}, function(err) {
      if(err) rej(err)
      res()
    })
  })
}
(node:6448) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: EPERM: operation
 not permitted, rename 'D:\Users\SHANGW~1\AppData\Local\Temp\e89c0fcd-88a4-40f6-85e6-982dfca3f4f2' -> 'D:\dev\github
\auto-activity\static\projects\lotteryNine-12\index.html'

dxcqcv avatar Oct 09 '17 05:10 dxcqcv

Just tested the simplest scenario on Windows 7. Can't reproduce in regular usage :

mv ('file', 'dir1\\file2', (err) => { err ? console.error(err) : console.log('moved') })

vasyl-shumskyi avatar Jul 16 '18 13:07 vasyl-shumskyi