mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-09 22:48:57 +02:00
* export PathConv(RawByteString) from the system unit and import/use it in
the sysutils unit instead of the ShortString version git-svn-id: branches/cpstrrtl@25077 -
This commit is contained in:
parent
60365489e2
commit
c0d2ebb682
@ -147,7 +147,7 @@ begin
|
||||
end;
|
||||
|
||||
{ Converts an Unix-like path to Amiga-like path }
|
||||
function PathConv(const path: rawbytestring): rawbytestring;
|
||||
function PathConv(const path: rawbytestring): rawbytestring; alias: 'PATHCONVRBS'; [public];
|
||||
var tmppos: longint;
|
||||
begin
|
||||
{ check for short paths }
|
||||
|
@ -59,6 +59,7 @@ uses dos,sysconst;
|
||||
|
||||
{ * Followings are implemented in the system unit! * }
|
||||
function PathConv(path: shortstring): shortstring; external name 'PATHCONV';
|
||||
function PathConv(path: RawByteString): shortstring; external name 'PATHCONVRBS';
|
||||
procedure AddToList(var l: Pointer; h: LongInt); external name 'ADDTOLIST';
|
||||
function RemoveFromList(var l: Pointer; h: LongInt): boolean; external name 'REMOVEFROMLIST';
|
||||
function CheckInList(var l: Pointer; h: LongInt): pointer; external name 'CHECKINLIST';
|
||||
@ -112,13 +113,10 @@ function FileOpen(const FileName: rawbytestring; Mode: Integer): LongInt;
|
||||
var
|
||||
SystemFileName: RawByteString;
|
||||
dosResult: LongInt;
|
||||
tmpStr : array[0..255] of char;
|
||||
begin
|
||||
SystemFileName:=ToSingleByteFileSystemEncodedFileName(FileName);
|
||||
SystemFileName:=PathConv(ToSingleByteFileSystemEncodedFileName(FileName));
|
||||
{$WARNING FIX ME! To do: FileOpen Access Modes}
|
||||
{$WARNING FIX ME! PathConv takes a shortstring, which means 255 char truncation and conversion to defaultsystemcodepage, ignoring the defaultfilesystemcodepage setting}
|
||||
tmpStr:=PathConv(SystemFileName)+#0;
|
||||
dosResult:=Open(@tmpStr,MODE_OLDFILE);
|
||||
dosResult:=Open(PChar(SystemFileName),MODE_OLDFILE);
|
||||
if dosResult=0 then
|
||||
dosResult:=-1
|
||||
else
|
||||
@ -145,12 +143,9 @@ function FileCreate(const FileName: RawByteString) : LongInt;
|
||||
var
|
||||
SystemFileName: RawByteString;
|
||||
dosResult: LongInt;
|
||||
tmpStr : array[0..255] of char;
|
||||
begin
|
||||
SystemFileName:=ToSingleByteFileSystemEncodedFileName(FileName);
|
||||
{$WARNING FIX ME! PathConv takes a shortstring, which means 255 char truncation and conversion to defaultsystemcodepage, ignoring the defaultfilesystemcodepage setting}
|
||||
tmpStr:=PathConv(FileName)+#0;
|
||||
dosResult:=Open(@tmpStr,MODE_NEWFILE);
|
||||
SystemFileName:=PathConv(ToSingleByteFileSystemEncodedFileName(FileName));
|
||||
dosResult:=Open(PChar(FileName),MODE_NEWFILE);
|
||||
if dosResult=0 then
|
||||
dosResult:=-1
|
||||
else
|
||||
|
@ -138,7 +138,7 @@ end;
|
||||
|
||||
|
||||
{ Converts an Unix-like path to Amiga-like path }
|
||||
function PathConv(const path: rawbytestring): rawbytestring;
|
||||
function PathConv(const path: rawbytestring): rawbytestring; alias: 'PATHCONVRBS'; [public];
|
||||
var tmppos: longint;
|
||||
begin
|
||||
{ check for short paths }
|
||||
|
@ -61,6 +61,7 @@ uses dos,sysconst;
|
||||
|
||||
{ * Followings are implemented in the system unit! * }
|
||||
function PathConv(path: shortstring): shortstring; external name 'PATHCONV';
|
||||
function PathConv(path: RawByteString): shortstring; external name 'PATHCONVRBS';
|
||||
procedure AddToList(var l: Pointer; h: LongInt); external name 'ADDTOLIST';
|
||||
function RemoveFromList(var l: Pointer; h: LongInt): boolean; external name 'REMOVEFROMLIST';
|
||||
function CheckInList(var l: Pointer; h: LongInt): pointer; external name 'CHECKINLIST';
|
||||
@ -133,13 +134,10 @@ function FileOpen(const FileName: rawbytestring; Mode: Integer): LongInt;
|
||||
var
|
||||
SystemFileName: RawByteString;
|
||||
dosResult: LongInt;
|
||||
tmpStr : array[0..255] of char;
|
||||
begin
|
||||
SystemFileName:=ToSingleByteFileSystemEncodedFileName(FileName);
|
||||
SystemFileName:=PathConv(ToSingleByteFileSystemEncodedFileName(FileName));
|
||||
{$WARNING FIX ME! To do: FileOpen Access Modes}
|
||||
{$WARNING FIX ME! PathConv takes a shortstring, which means 255 char truncation and conversion to defaultsystemcodepage, ignoring the defaultfilesystemcodepage setting}
|
||||
tmpStr:=PathConv(SystemFileName)+#0;
|
||||
dosResult:=Open(@tmpStr,MODE_OLDFILE);
|
||||
dosResult:=Open(PChar(SystemFileName),MODE_OLDFILE);
|
||||
if dosResult=0 then
|
||||
dosResult:=-1
|
||||
else
|
||||
@ -209,17 +207,14 @@ function FileCreate(const FileName: RawByteString) : LongInt;
|
||||
var
|
||||
SystemFileName: RawByteString;
|
||||
dosResult: LongInt;
|
||||
tmpStr : array[0..255] of char;
|
||||
begin
|
||||
dosResult:=-1;
|
||||
|
||||
{ Open file in MODDE_READWRITE, then truncate it by hand rather than
|
||||
opening it in MODE_NEWFILE, because that returns an exclusive lock
|
||||
so some operations might fail with it (KB) }
|
||||
SystemFileName:=ToSingleByteFileSystemEncodedFileName(FileName);
|
||||
{$WARNING FIX ME! PathConv takes a shortstring, which means 255 char truncation and conversion to defaultsystemcodepage, ignoring the defaultfilesystemcodepage setting}
|
||||
tmpStr:=PathConv(SystemFileName)+#0;
|
||||
dosResult:=Open(@tmpStr,MODE_READWRITE);
|
||||
SystemFileName:=PathConv(ToSingleByteFileSystemEncodedFileName(FileName));
|
||||
dosResult:=Open(PChar(SystemFileName),MODE_READWRITE);
|
||||
if dosResult = 0 then exit;
|
||||
|
||||
if SetFileSize(dosResult, 0, OFFSET_BEGINNING) = 0 then
|
||||
|
Loading…
Reference in New Issue
Block a user