Coder's Guild Mailing List

CopyFile, DeleteFile in Delphi 4

Posted by Morgan Terry on 1999-09-30

Hey all you Delphi coders, I've been having a problem copying an ini
file (which I just made using TInifile.create, inifile.writestring,
inifile.free) in Delphi 4.  I am trying to copy the file using
 	CopyFile(PChar(filename), PChar(filename + '.txt'), true); 
then later Delete it using 
	DeleteFile(filename);

I have the following variabled declared in my procedure:
var
  filename: String;
  inifile: TIniFile;

Now, my problem is this:
	CopyFile() isn't actually copying the file correctly.  I get a new
file, but it it just a bunch of binary characters (obviously not the ini
file that I'm trying to copy).  Also, the original file never gets
deleted.  Anyone have any insight as to what is happening?
-- 
Morgan
morgan@xxxxxxxxxxx.xxx