Click here to Skip to main content
15,881,852 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an application that runs an inspection system and then moves & renames the resulting image files to a data folder. I used FindFirstFile(), MoveFile(), and FindNextFile() renaming the file on the move. Now I need to put the image files in a folder on a mapped drive. CreateDirectory() works great at building the directory structure on the mapped drive but ( as I am sure you all know!) MoveFile() fails. Is this a path definition issue? Do I need to specify the mapped drive as a URL? Any help will be greatly appreciated!

Ron H. ( In MN where we just got another 7 inches of heavey wet snow on my tulips! Errr!)
Posted
Comments
pasztorpisti 19-Apr-13 5:23am    
We don't know the exact parameters of your utility and my hints may sound obvious and foolish but MoveFile() can move files/dirs only between the directories of the same drive/volume. Between different directories you have to perform a file copy+delete combo. The MoveFile() documentation has some other comments for SMB that may be irrelevant in your case: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365239%28v=vs.85%29.aspx
Malli_S 19-Apr-13 5:26am    
Oops !!! :)

The MoveFile will always fail if the destination path is on different volume. Better you copy and then delete the source file manually.

For your reference check this[^].
 
Share this answer
 
v2
The MoveFile will fail on Directory moves I do not think on file move to be a problem.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900