Search results for '8.3 format file name'. 1 post(s) found.

  1. 2007/09/10 From/to the 8.3 (short) format to/from the long format
2007/09/10 16:21

From/to the 8.3 (short) format to/from the long format


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}
Trackback 3 Comment 0

Trackback : Cannot send a trackbact to this post.

  1. Subject different money making ideas

    Tracked from moneyideas 2010/01/29 05:11 delete

    moneyideas

  2. Subject different money making ideas

    Tracked from moneyideas 2010/01/29 13:57 delete

    moneyideas

  3. Subject different money making ideas

    Tracked from moneyideas 2010/01/31 16:39 delete

    moneyideas