move a file in another repertory

Hi everybody!!

If someone can tell me how to copy or move a file in a repertory X to another repertoy Y in C. (not C++)
I try to find a function in C which can move (or copy) a file but, I think that there aren't.

Which operating system?

1. Way:
Read the file and write it to the other location. Then delete the source file.
2. Way:
Use builtin API function to move the file.
If you are using Windows:
1
2
3
4
BOOL WINAPI MoveFile(
  __in  LPCTSTR lpExistingFileName,
  __in  LPCTSTR lpNewFileName
);

Source: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365239%28v=vs.85%29.aspx
Topic archived. No new replies allowed.