Click here to Skip to main content
11,802,762 members (70,615 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C++ MFC
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 18-Apr-13 22:35pm
pasztorpisti at 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:
Malli_S at 19-Apr-13 5:26am
Oops !!! :)
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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[^].
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

The MoveFile will fail on Directory moves I do not think on file move to be a problem.

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

  Print Answers RSS
0 KrunalRohit 366
1 OriginalGriff 365
2 F-ES Sitecore 295
3 CPallini 270
4 Sergey Alexandrovich Kryukov 239
0 OriginalGriff 2,950
1 Maciej Los 1,910
2 KrunalRohit 1,862
3 CPallini 1,695
4 Richard MacCutchan 1,157

Advertise | Privacy | Mobile
Web04 | 2.8.151002.1 | Last Updated 6 Jun 2014
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100