Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Pascal
Expertise: Beginner
Mar 19, 1997

MoveFile command (Delphi 32)

Question:
The MoveFile command does not work for me with some filenames. An example is as follows :
MoveFile('C:\CIPL\INCOMING\199702110408440000000000.SAV', 'C:\CIPL\ARCHIVE\');
yet, if I try to move a file called 'test.sav' with the same line, it works. In the first case - Delphi just refuses to move the file. It doesn't crash. I looked up MoveFile - and it makes a direct call to kernel32.dll. I am using the updated version of Windows 95 (OSR2). Are there any alternatives to moving files? (i've tried CopyFile and DeleteFile - but that does not solve the problem either).

Answer:
You might try enclosing the entire path in double quotes, so your line reads as follows:

MoveFile('"C:\CIPL\INCOMING\199702110408440000000000.SAV"','C:\CIPL\ARCHIVE\');
This is a Windows thing. Any 8.3 DOS format files will work, but double-quoting seems to solve a lot of these types of problems.
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date