Browse Source

* Implemented ExtractShortPathName

git-svn-id: trunk@9595 -
michael 17 years ago
parent
commit
eec321b2f8
2 changed files with 13 additions and 2 deletions
  1. 12 2
      rtl/objpas/sysutils/fina.inc
  2. 1 0
      rtl/objpas/sysutils/finah.inc

+ 12 - 2
rtl/objpas/sysutils/fina.inc

@@ -113,9 +113,19 @@ begin
     Result := '';
 end;
 
+function ExtractShortPathName(Const FileName : String) : String;
 
-  type
-    PathStr=string;
+begin
+{$ifdef MSWINDOWS} 
+  SetLength(Result,Max_Path);
+  SetLength(Result,GetShortPathName(PChar(FileName), Pchar(Result),Length(Result)));
+{$else}
+  Result:=FileName;
+{$endif}
+end;
+
+type
+  PathStr=string;
 
 {$DEFINE FPC_FEXPAND_SYSUTILS}
 

+ 1 - 0
rtl/objpas/sysutils/finah.inc

@@ -30,6 +30,7 @@ function ExtractFileDrive(const FileName: string): string;
 function ExtractFileName(const FileName: string): string;
 function ExtractFileExt(const FileName: string): string;
 function ExtractFileDir(Const FileName : string): string;
+function ExtractShortPathName(Const FileName : String) : String;
 function ExpandFileName (Const FileName : string): String;
 function ExpandUNCFileName (Const FileName : string): String;
 function ExtractRelativepath (Const BaseName,DestNAme : String): String;