rename failed in Centos 6.2 64 bits

554 views
Skip to first unread message

Angelo Chen

unread,
Feb 3, 2012, 9:20:15 PM2/3/12
to nodejs
Hi,

following code works in centos 5.7 32 bits and OS X Lion 64 bits, but
failed in centos 6.2 64 bits, any idea?

the difference is, in 6.2 I installed node v0.6.10 while in others, I
use node v0.6.6

Thanks.


function move_tempfile_proc(f, p_id) {
console.log(f)
var path = f.path
var filename = settings.images_dir + "/" + f.filename
var resized_to = f.filename
fs.rename(path, filename, function(err) {
console.log(err) // got UNKNOWN error here
})
}




Express server listening on port 8080 in development mode

the object of uploaded file:

{ size: 4993730,
path: '/tmp/48504c73cf18f2ac409407ce4056a74c',
name: 'DSC02891.JPG',
type: 'image/jpeg',
lastModifiedDate: Sat, 04 Feb 2012 02:00:03 GMT,
_writeStream:
{ path: '/tmp/48504c73cf18f2ac409407ce4056a74c',
fd: 7,
writable: false,
flags: 'w',
encoding: 'binary',
mode: 438,
bytesWritten: 4993730,
busy: false,
_queue: [],
drainable: true },
length: [Getter],
filename: [Getter],
mime: [Getter] }

the err dump:

{ [Error: UNKNOWN, unknown error '/tmp/
48504c73cf18f2ac409407ce4056a74c']
errno: -1,
code: 'UNKNOWN',
path: '/tmp/48504c73cf18f2ac409407ce4056a74c' }

Ben Noordhuis

unread,
Feb 4, 2012, 10:32:21 AM2/4/12
to nod...@googlegroups.com

Are /tmp and the target directory on different mounts? rename() only
works when they're on the same mount.

Reply all
Reply to author
Forward
0 new messages