Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

node.js rename and AWS

node.js rename and AWS

Problem

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?

Problem courtesy of: Paul Beusterien

Solution

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.

Solution courtesy of: Eric Hammond

Discussion

View additional discussion.



This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

node.js rename and AWS

×

Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription

×