Скачать Long Filename DOS Unit

08.01.1997
Скачать файл (2,67 Кб)




 Long filename DOS unit, Arne de Bruijn, 19960402, Public Domain
 All functions return the errorcode, and store it in DosError in
 the Dos unit.
 The functions work only if Windows 95 is loaded!
function LFindFirst(FileSpec:pchar; Attr:word;
                    var SRec:TLSearchRec):word;
{ Search for files }
 
 
function LFindNext(var SRec:TLSearchRec):word;
{ Find next file }
 
function LFindClose(var SRec:TLSearchRec):word;
{ Free search handle }
 
function LTruename(FileName:pchar; Result:pchar):word;
{ Return complete path, if relative uppercased longnames }
{ added, in buffer. Result (261 bytes) }
 
function LGetShortName(FileName:pchar; Result:pchar):word;
{ Return complete short name/path for input file/path in }
{ buffer. Result (79 bytes) }
 
function LGetLongName(FileName:pchar; Result:pchar):word;
{ Return complete long name/path for input file/path in buffer }
{ Result (261 bytes) }
 
function LFileSystemInfo(RootName:pchar; FSName:pchar; FSNameBufSize:word;
 var Flags,MaxFileNameLen,MaxPathLen:word):word;
{ Return File System Information, for FSName 32 bytes should be sufficient }
{ Rootname is for example 'C:\' }
{ Flags: }
{ bit
{  0   searches are case sensitive }
{  1   preserves case in directory entries }
{  2   uses Unicode characters in file and directory names }
{ 3-13 reserved (0) }
{ 14   supports DOS long filename functions }
{ 15   volume is compressed }
 
 
function LErase(Filename:pchar):word;
{ Erase file }
 
function LMkDir(Directory:pchar):word;
{ Make directory }
 
function LRmDir(Directory:pchar):word;
{ Remove directory }
 
function LChDir(Directory:pchar):word;
{ Change current directory }
 
function LGetDir(Drive:byte; Result:pchar):word;
{ Get current drive and directory.
  Drive: 0=current, 1=A: etc. }
 
function LGetAttr(Filename:pchar; var Attr:word):word;
{ Get file attributes}
 
function LSetAttr(Filename:pchar; Attr:word):word;
{ Set file attributes }
 
function LRename(OldFilename,NewFilename:pchar):word;
{ Rename file }
 
function LTimeToDos(var LTime:comp):longint;
{ Convert 64-bit number of 100ns since 01-01-1601 UTC
  to local DOS format time
  (LTime is var to avoid putting it on the stack) }
 
procedure UnpackLTime(var LTime:comp; var DT:DateTime);
{ Convert 64-bit time to date/time record }