mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-21 05:09:31 +02:00
* more deprecated fixes
git-svn-id: trunk@7718 -
This commit is contained in:
parent
0ef2cb0b02
commit
58e3f8ad0d
@ -363,7 +363,7 @@ End;
|
|||||||
|
|
||||||
{
|
{
|
||||||
The Diskfree and Disksize functions need a file on the specified drive, since this
|
The Diskfree and Disksize functions need a file on the specified drive, since this
|
||||||
is required for the statfs system call.
|
is required for the fpstatfs system call.
|
||||||
These filenames are set in drivestr[0..26], and have been preset to :
|
These filenames are set in drivestr[0..26], and have been preset to :
|
||||||
0 - '.' (default drive - hence current dir is ok.)
|
0 - '.' (default drive - hence current dir is ok.)
|
||||||
1 - '/fd0/.' (floppy drive 1 - should be adapted to local system )
|
1 - '/fd0/.' (floppy drive 1 - should be adapted to local system )
|
||||||
@ -403,8 +403,8 @@ Function DiskFree(Drive: Byte): int64;
|
|||||||
var
|
var
|
||||||
fs : tstatfs;
|
fs : tstatfs;
|
||||||
Begin
|
Begin
|
||||||
if ((Drive<4) and (not (fixdrivestr[Drive]=nil)) and (StatFS(fixdrivestr[drive],fs)<>-1)) or
|
if ((Drive<4) and (not (fixdrivestr[Drive]=nil)) and (fpStatFS(fixdrivestr[drive],@fs)<>-1)) or
|
||||||
((not (drivestr[Drive]=nil)) and (StatFS(drivestr[drive],fs)<>-1)) then
|
((not (drivestr[Drive]=nil)) and (fpStatFS(drivestr[drive],@fs)<>-1)) then
|
||||||
Diskfree:=int64(fs.bavail)*int64(fs.bsize)
|
Diskfree:=int64(fs.bavail)*int64(fs.bsize)
|
||||||
else
|
else
|
||||||
Diskfree:=-1;
|
Diskfree:=-1;
|
||||||
@ -416,8 +416,8 @@ Function DiskSize(Drive: Byte): int64;
|
|||||||
var
|
var
|
||||||
fs : tstatfs;
|
fs : tstatfs;
|
||||||
Begin
|
Begin
|
||||||
if ((Drive<4) and (not (fixdrivestr[Drive]=nil)) and (StatFS(fixdrivestr[drive],fs)<>-1)) or
|
if ((Drive<4) and (not (fixdrivestr[Drive]=nil)) and (fpStatFS(fixdrivestr[drive],@fs)<>-1)) or
|
||||||
((not (drivestr[Drive]=nil)) and (StatFS(drivestr[drive],fs)<>-1)) then
|
((not (drivestr[Drive]=nil)) and (fpStatFS(drivestr[drive],@fs)<>-1)) then
|
||||||
DiskSize:=int64(fs.blocks)*int64(fs.bsize)
|
DiskSize:=int64(fs.blocks)*int64(fs.bsize)
|
||||||
else
|
else
|
||||||
DiskSize:=-1;
|
DiskSize:=-1;
|
||||||
|
Loading…
Reference in New Issue
Block a user