Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RENAME across different drives

Status
Not open for further replies.

Gilesy

Programmer
Jul 2, 2002
40
GB
Hi folks.
Having a problem with the RENAME command.
I have a line RENAME (File1) TO (file2)

Where File1 is "T:\spare\temp\12345678.tmp"
And file2 is "data\newfile.txt"

I get the error "Attempt to move file to a different device"

Other than prevent the user having a temp directory on a different drive, I cannot find a solution.

Any suggestions?

Thanks
 
Hi,

To use RENAME command, file1 and file2 must be in the same path. Use COPY FILE <file1> TO <file2> instead.
 
To expand on the previous suggestion, use the Justdrive() function to make sure that the drives are the same before using RENAME. If they are different, then you'll need to use the COPY and ERASE commands.

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top