Board index » delphi » CL - LoadFromFile/SaveToFile

CL - LoadFromFile/SaveToFile

Can anyone tell me why the following code returns the
error:

       File [TargetFile] cannot be created

CopyList.LoadFromFile(SourceFile);
CopyList.SaveToFile(TargetFile);

CopyList is create first, SourceFile does exists and
TargetFile does not exist.

tia

--
Kees Lagendijk
--------------
T +31 76 549 37 50
F +31 76 549 30 35
M +31 65 464 85 67
http://www.assbreda.nl

"Messing things up is easy but to
   really create chaos you need a computer..."

 

Re:CL - LoadFromFile/SaveToFile


In article <7imlnp$9u...@news.casema.net>,
  "Kees Lagendijk" <k...@REMOVETHIScasema.net> wrote:

Quote
> Can anyone tell me why the following code returns the
> error:

>        File [TargetFile] cannot be created

> CopyList.LoadFromFile(SourceFile);
> CopyList.SaveToFile(TargetFile);

> CopyList is create first, SourceFile does exists and
> TargetFile does not exist.

     Does the directory where you want to create TargetFile
exist? If not you need to create it first (ForceDirectories
(in FileCtrl.pas) and ExtractFilePath can be useful here.)

Quote
> tia

> --
> Kees Lagendijk
> --------------
> T +31 76 549 37 50
> F +31 76 549 30 35
> M +31 65 464 85 67
> http://www.assbreda.nl

> "Messing things up is easy but to
>    really create chaos you need a computer..."

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

Other Threads