You've already forked lazarus-ccr
RxFPC:GetFileOwnerData now work on linux
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4640 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -45,11 +45,12 @@ function GetUserName:string;
|
||||
|
||||
implementation
|
||||
|
||||
{$IFDEF WINDOWS}
|
||||
uses
|
||||
Windows;
|
||||
{$IFDEF WINDOWS}
|
||||
Windows
|
||||
{$ELSE}
|
||||
{$ENDIF}
|
||||
BaseUnix, users
|
||||
{$ENDIF};
|
||||
(*
|
||||
FileUtil, LazFileUtils, LazUTF8;
|
||||
*)
|
||||
@ -153,6 +154,8 @@ end;
|
||||
|
||||
procedure GetFileOwnerData(const SearchDomain, FileName: String; out UserName,
|
||||
DomainName: string);
|
||||
var
|
||||
SR: stat;
|
||||
begin
|
||||
{$IF DEFINED(WINDOWS) AND NOT DEFINED(WINCE)}
|
||||
{ GetFileNameOwner(UTF8ToSys(SearchDomain), UTF8ToSys(FileName), UserName, DomainName);
|
||||
@ -160,8 +163,9 @@ begin
|
||||
DomainName:=UTF8Encode(DomainName);}
|
||||
GetFileNameOwner(SearchDomain, FileName, UserName, DomainName);
|
||||
{$ELSE}
|
||||
UserName:='';
|
||||
DomainName:='';
|
||||
FpStat(FileName, SR);
|
||||
UserName:=users.GetUserName(SR.uid);
|
||||
DomainName:='';//IntToStr( SR.gid);
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
|
Reference in New Issue
Block a user