Re: "Access denied" on file copy



> 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));

.



Relevant Pages

  • Re: IMAP server alternatives
    ... Personally I have had no issues with IMAP-UW, but the users in our office have had issues with the mbox format itself. ... Specifically they cannot store messages & subfolders within a folder. ... I saw a dramatic improvement in speed with both Thunderbird and Squirrelmail after switching from mbox to maildir. ...
    (freebsd-questions)
  • Re: Word 6.0 documents in Word 2004
    ... Tell her to create a new folder: Word2004 Copies, ... I would also be interested to check what her "Default" save format is. ... McGhie Information Engineering Pty Ltdhttp://jgmcghie.fastmail.com.au/ ... two prompts and the deed was accomplished. ...
    (microsoft.public.mac.office.word)
  • Re: Word 6.0 documents in Word 2004
    ... :-) This is the first time I have heard of your ... Tell her to create a new folder: Word2004 Copies, ... I would also be interested to check what her "Default" save format is. ... two prompts and the deed was accomplished. ...
    (microsoft.public.mac.office.word)
  • windows explorer problems
    ... The folder contains avi files and mp3 files formats. ... of the external hard disk 40GB also having problems after I stored some avi ... to format however I cannot finish the formation. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Why cant I save to my D: Drive?!
    ... guess I haven't tried to burn any CDs since this problem has come up. ... To do that you need to format the CD. ... Roxio and Nero have programs that will format a CD allowing you to use the CD as ... It is messy and I prefer to have a folder ...
    (microsoft.public.windowsxp.help_and_support)