Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com Sep 10 '12 at 4:51

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

1 Answer 1

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

share|improve this answer
1  
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

 
discard

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.