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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RENAME FILE 1

Status
Not open for further replies.

PEM000

Programmer
Mar 24, 2003
1
CH
Hello,

I Would like to rename a file in Clipper. I found the command RENAME file1 to file2, but the max length of file2 is 8.3 and I would like to rename my file with a name such as : xxxxxxxx2003032508:00:00.txt. How is ist possible to do this ?

PEM
 
This is only possible if you add long filename support to Clipper, OR you create the file in 8.3 format and rename it with the RUN command to a long filename.
After changing the name, you can't access it any longer, as you wont know the short name for that file, and you can't use the long name... s-)

HTH
TonHu
 
The limitation of this lib is, it doesn't add long filename support to native clipper functions, so you still can't open databases or other files, without converting to a short name. But this sure makes it do-able ;-)
Like this perhaps?
Code:
...
USE FixLongFilename(FileToOpen) ALIAS (UseThisAlias)
...

Function FixLongFilename(fn__)
#IfDef UseLFNLIB
  fn__ := LF_ToShort(fn__)
#Else
  // Do Nothing...
#Endif
Return(fn__)  // Function FixLongFilename

Gee, I was so enthousiast about this lib a few weeks ago, Ian, and I forgot it when writing this answer :-(

Thnks,
TonHu
 
TonHu,

Did you get hold of Klas Engwall's LanMan Library? It allows you to make and break Windows (Lan Manager based) net connections. He's a clever bloke that Klas. Ian Boys
DTE Systems Ltd
 
Ian,

I just had a look, and I can come to only 1 conclusion: This Klas Engwall guy deserves a pedestal, a medal and a bouqet of roses!

Thanks for the tip! A star is coming down to you

You might take up the task of writing a FAQ about this redirection thing ;-) A lot of questions would then be answered

Thnks
TonHu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top