0

Possible Duplicate:
Move file to a different partition using node.js

I'm using fs.renameSync to rename a /tmp file to a file in a directory on a mounted EBS file-system on an AWS micro-instance. I get the error :

Error: EXDEV, Invalid cross-device link '/tmp/55fb21262ba306f70e2d7ccaac5a59e0'
at Object.renameSync (fs.js:320:18)

The rename works fine on my local server. I'm running node with sudo on AWS and have write access to both directories.

Also, the mv command works fine, which with spawn, could be my workaround.

Is there something special about /tmp on the AWS micro-instance?

Community
  • 1
  • 1
Paul Beusterien
  • 27,542
  • 6
  • 83
  • 139

1 Answers1

2

This is a duplicate of: How do I move file a to a different partition or device in Node.js?

You can't create cross-device hard links, which apparently fs.renameSync does. An EBS volume is a different device than where /tmp is mounted.

Community
  • 1
  • 1
Eric Hammond
  • 22,089
  • 5
  • 66
  • 75
  • Thanks! util.pump does the job. I didn't find that link despite a few search tries. Hopefully this question will pick up future searchers. – Paul Beusterien Oct 03 '11 at 04:15