Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am moving a file from /tmp/ folder to another path. I am using "rename" function to move file to another path. But rename returns -1 and errno = 18 (Invalid cross-device link). Error no 18 means: "The directory containing the name newname must be on the same file system as the file (as indicated by the name oldname)"

Can someone suggest a way to move this file.

share|improve this question

migrated from Sep 10 '12 at 4:51

This question came from our site for professional and enthusiast programmers.

If rename() is failing, you need to do the move manually, i.e. implement a copy-and-delete scheme.

share|improve this answer
I am creating a sqlite database in temp folder. Now I want to copy that file to another folder. Is there any sqlite command to rename the sqlite database file? I was trying with rename function. but it fails with error 18 – Sandy Sep 3 '12 at 12:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.