Re: "Access denied" on file copy
- From: "swansnow" <schultz@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: 15 Sep 2005 12:44:43 -0700
> Is your path correct? What does the format of your path look like?
(btw, I'm using Google, sorry if the formatting is strange)
I have this problem elsewhere in my program, too, so I think it has
something to do with the network or the remote machine, because when I
try to access local folders to do the copying there is no problem.
connDataDir is a connection object, so getConnectionPath returns
something like J:\app\dataDir\sample and newDir ends up being
something like J:\app\dataDir\newFolder I've verified this by looking
at the value of the variables at runtime.
ForceDirectories succeeds, but CopyFile doesn't. The file being copied
is not being used, so it isn't locked.
The CopyFile is trying to copy the file sample.add from the sample
folder to the newFolder folder.
===
path := leftStr(connDataDir.getConnectionPath, LastDelimiter('\',
connDataDir.getConnectionPath));
newDir := path + edFolder.Text;
forceDirectories(newDir);
{Copy data dictionary files into new folder}
error := false;
path := connTmp.GetConnectionPath;
if not CopyFile(PChar(path + '\sample.add'), PChar(newDir), False)
then
ShowMessage('File not copied, error code = '+
IntToStr(GetLastError));
.
- Follow-Ups:
- Re: "Access denied" on file copy
- From: J French
- Re: "Access denied" on file copy
- From: Nicholas Sherlock
- Re: "Access denied" on file copy
- References:
- "Access denied" on file copy
- From: swansnow
- Re: "Access denied" on file copy
- From: Nicholas Sherlock
- "Access denied" on file copy
- Prev by Date: Re: Manipulate objects by reference
- Next by Date: [D7 Newbie] Exception while closing busy file
- Previous by thread: Re: "Access denied" on file copy
- Next by thread: Re: "Access denied" on file copy
- Index(es):
Relevant Pages
|
|