* 1.9.x fixes

This commit is contained in:
marco 2004-07-18 11:57:11 +00:00
parent f498e954a5
commit 7dcad07b60
12 changed files with 26 additions and 19 deletions

View File

@ -2,7 +2,7 @@ Program Example39;
{ Program to demonstrate the GetDomainName function. }
Uses linux;
Uses Unix;
begin
Writeln ('Domain name of this machine is : ',GetDomainName);

View File

@ -2,7 +2,7 @@ Program Example40;
{ Program to demonstrate the GetHostName function. }
Uses linux;
Uses unix;
begin
Writeln ('Name of this machine is : ',GetHostName);

View File

@ -2,8 +2,8 @@ Program Example41;
{ Program to demonstrate the GetEnv function. }
Uses linux;
Uses BaseUnix;
begin
Writeln ('Path is : ',Getenv('PATH'));
Writeln ('Path is : ',fpGetenv('PATH'));
end.

View File

@ -2,11 +2,14 @@ Program Example42;
{ Program to demonstrate the SysInfo function. }
{$ifdef Linux} // is Linux specific.
Uses linux;
Var Info : TSysinfo;
{$endif}
begin
{$ifdef Linux}
If SysInfo (Info) then
With info do
begin
@ -19,4 +22,5 @@ begin
Writeln ('Free swap : ',FreeSwap Div 1024,'Kb.');
Writeln ('No. Processes : ',procs);
end;
{$endif}
end.

View File

@ -2,12 +2,12 @@ Program Example43;
{ Program to demonstrate the Uname function. }
Uses linux;
Uses BaseUnix;
Var UN : utsname;
begin
if Uname (UN) then
if fpUname (UN)=0 then
With UN do
begin
Writeln ('Name : ',pchar(@sysname[0]));
@ -15,6 +15,8 @@ begin
Writeln ('release : ',pchar(@Release[0]));
Writeln ('Version : ',pchar(@Version[0]));
Writeln ('Machine : ',pchar(@Machine[0]));
{$ifdef Linux} // linuxism
Writeln ('Domainname : ',pchar(@domainname[0]));
{$endif}
end;
end.

View File

@ -2,8 +2,8 @@ Program Example44;
{ Program to demonstrate the Octal function. }
Uses linux;
begin
Writeln ('Octal(666) : ',octal(666));
// Writeln ('Octal(666) : ',octal(666));
Writeln (' &666 : ',&666); // 1.9.x+ functionality, octal is not necessary anymore
end.

View File

@ -2,7 +2,7 @@ Program Example45;
{ Program to demonstrate the FExpand function. }
Uses linux;
Uses Unix;
begin
Writeln ('This program is in : ',FExpand(Paramstr(0)));

View File

@ -2,8 +2,8 @@ Program Example46;
{ Program to demonstrate the FSearch function. }
Uses linux,strings;
Uses BaseUnix, Unix, Strings;
begin
Writeln ('ls is in : ',FSearch ('ls',strpas(Getenv('PATH'))));
Writeln ('ls is in : ',FSearch ('ls',strpas(fpGetenv('PATH'))));
end.

View File

@ -2,7 +2,7 @@ Program Example47;
{ Program to demonstrate the DirName function. }
Uses linux;
Uses Unix,UnixUtil;
Var S : String;

View File

@ -2,7 +2,7 @@ Program Example48;
{ Program to demonstrate the BaseName function. }
Uses linux;
Uses Unix,UnixUtil;
Var S : String;

View File

@ -2,13 +2,13 @@ Program Example49;
{ Program to demonstrate the Glob and GlobFree functions. }
Uses linux;
Uses BaseUnix,Unix;
Var G1,G2 : PGlob;
begin
G1:=Glob ('*');
if LinuxError=0 then
if fpgeterrno=0 then
begin
G2:=G1;
Writeln ('Files in this directory : ');

View File

@ -1,15 +1,16 @@
Program Example51;
{ Program to demonstrate the StringToPPChar function. }
{ Program to demonstrate the StringToPPChar function.
This function is pretty obsolete }
Uses linux;
Uses UnixUtil;
var P : PPChar;
S : String;
begin
S:='/bin/ls -l -F';
P:=StringToPPChar(S);
P:=StringToPPChar(S,0);
Writeln ('Name : ',p^); inc(longint(p),4);
writeln ('Option 1 : ',p^); inc(longint(p),4);
writeln ('Option 2 : ',p^);
end.
end.