Board index » cppbuilder » CopyFile() to a network drive doesn't work
Dave
![]() CBuilder Developer |
Dave
![]() CBuilder Developer |
CopyFile() to a network drive doesn't work2004-08-29 09:16:50 PM cppbuilder47 Hi, I'm trying to copy a file from my local harddisk to a network drive and i can't get it to work using CopyFile. Anyone know how to do that? Thanks, Dave |
Vladimir Stefanovic
![]() CBuilder Developer |
2004-08-30 02:32:46 AM
Re:CopyFile() to a network drive doesn't workQuoteI'm trying to copy a file from my local harddisk to a special attributes like read-only or similar, or just try to copy any file with Explorer to the destination drive/folder to check the accessibility. Best regards, Vladimir Stefanovic |
Dave
![]() CBuilder Developer |
2004-08-30 12:58:06 PM
Re:CopyFile() to a network drive doesn't work
On Sun, 29 Aug 2004 20:32:46 +0200, Vladimir Stefanovic wrote:
Quote>I'm trying to copy a file from my local harddisk to a AnsiString Source, Destination; CopyFile(Source.c_str(), Destination.c_str(), true); Try it on local disk just fine but with a network drive it fails, I tried CopyFileEx() too and won't work either, Thanks Dave {smallsort} |
Ed Mulroy [TeamB]
![]() CBuilder Developer |
2004-08-30 06:59:16 PM
Re:CopyFile() to a network drive doesn't work
Write the two AnsiStrings to the screen and check that they are valid
paths and file names. It could be something as simple as the lack of doubled backslashes. Check if the network drive permissions allow the copy as Mr Stefanovic mentioned. Try doing a manual copy of a file from the command line to the network drive and then checking the existence and size of the destination file. Call SetLastError(0) prior to the call and then see what the error indicated by a call to GetLastError afterwards indicates. . Ed QuoteDave wrote in message |