Search results for '8.3 format file name'. 1 post(s) found.
This unit provides two functions that convert filenames from the long format to the 8.3 format, and from the 8.3 format to the long format.
LFN_ALT.pas
unit LFN_ALT;
interface
function AlternateToLFN(AltName:String):String;
function LFNToAlternate(LongName:String):String;
implementation
uses Windows;
function AlternateToLFN(AltName:String):String;
var
temp: TWIN32FindData;
searchHandle: THandle;
begin
searchHandle:=FindFirstFile(PChar(AltName),temp) ;
if searchHandle <> ERROR_INVALID_HANDLE then
result := String(temp.cFileName)
else
result := '';
Windows.FindClose(searchHandle) ;
end;
function LFNToAlternate(LongName:String):String;
var
temp: TWIN32FindData;
searchHandle: THandle;
begin
searchHandle:=FindFirstFile(PChar(LongName),temp) ;
if searchHandle <> ERROR_INVALID_HANDLE then
result := String(temp.cALternateFileName)
else
result := '';
Windows.FindClose(searchHandle) ;
end;
end.{unit}
interface
function AlternateToLFN(AltName:String):String;
function LFNToAlternate(LongName:String):String;
implementation
uses Windows;
function AlternateToLFN(AltName:String):String;
var
temp: TWIN32FindData;
searchHandle: THandle;
begin
searchHandle:=FindFirstFile(PChar(AltName),temp) ;
if searchHandle <> ERROR_INVALID_HANDLE then
result := String(temp.cFileName)
else
result := '';
Windows.FindClose(searchHandle) ;
end;
function LFNToAlternate(LongName:String):String;
var
temp: TWIN32FindData;
searchHandle: THandle;
begin
searchHandle:=FindFirstFile(PChar(LongName),temp) ;
if searchHandle <> ERROR_INVALID_HANDLE then
result := String(temp.cALternateFileName)
else
result := '';
Windows.FindClose(searchHandle) ;
end;
end.{unit}
Another posts included in "Delphi"
| Get File 'Last Modified' attribute (0) | 2007/09/10 |
| How to Split and Merge Files (0) | 2007/09/10 |
| Path shortener: c:\AB\C...DE\F.ghi (0) | 2007/09/10 |
| Delete folders recursively (0) | 2007/09/10 |
| Delete files with the ability to UNDO (0) | 2007/09/10 |
| Does my CD-ROM drive contain an audio CD? (0) | 2007/09/10 |
| Convert a mapped drive to a full UNC path (0) | 2007/09/10 |
| Checking If File Is In Use (0) | 2007/09/10 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/29 05:11
moneyideas
-
Subject different money making ideas
2010/01/29 13:57
moneyideas
-
Subject different money making ideas
2010/01/31 16:39
moneyideas

Prev

Rss Feed