On Sat, Feb 4, 2012 at 03:20, Angelo Chen <[email protected]> wrote:
> 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' }

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

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to