mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 14:27:59 +02:00
+ Added optional path translation mechanism
This commit is contained in:
parent
5846c1c9e8
commit
d4b4756c01
@ -56,7 +56,7 @@ Implementation
|
||||
|
||||
{TODO Perhaps add some kind of "Procedure AddDisk" for accessing other
|
||||
volumes. At lest accessing the possible disk drives with
|
||||
driver number 1 and 2 should be easy.}
|
||||
drive number 1 and 2 should be easy.}
|
||||
|
||||
{TODO Perhaps use LongDateTime for time functions. But the function
|
||||
calls must then be weak linked.}
|
||||
@ -736,7 +736,8 @@ End;
|
||||
if (Pos('?', Path) <> 0) or (Pos('*', Path) <> 0) then
|
||||
Exit;
|
||||
|
||||
path := TranslatePathToMac(path, false);
|
||||
if pathTranslation then
|
||||
path := TranslatePathToMac(path, false);
|
||||
|
||||
{Search in working directory, or as full path}
|
||||
fpcerr := PathArgToFSSpec(path, spec);
|
||||
@ -757,7 +758,11 @@ End;
|
||||
p1 := Pos(PathSeparator, DirList);
|
||||
if p1 = 0 then
|
||||
p1 := 255;
|
||||
NewDir := TranslatePathToMac(Copy(DirList, 1, P1 - 1), false);
|
||||
|
||||
if pathTranslation then
|
||||
NewDir := TranslatePathToMac(Copy(DirList, 1, P1 - 1), false)
|
||||
else
|
||||
NewDir := Copy(DirList, 1, P1 - 1);
|
||||
|
||||
NewDir := ConcatMacPath(NewDir, Path);
|
||||
|
||||
|
@ -396,6 +396,9 @@ function PathArgToFSSpec(s: string; var spec: FSSpec): Integer;
|
||||
var
|
||||
err: OSErr;
|
||||
begin
|
||||
if pathTranslation then
|
||||
s := TranslatePathToMac(s, false);
|
||||
|
||||
err:= FSMakeFSSpec(workingDirectorySpec.vRefNum,
|
||||
workingDirectorySpec.parID, s, spec);
|
||||
PathArgToFSSpec := MacOSErr2RTEerr(err);
|
||||
|
@ -220,7 +220,6 @@ var
|
||||
finderInfo: FInfo;
|
||||
|
||||
begin
|
||||
// AllowSlash(p);
|
||||
|
||||
{ close first if opened }
|
||||
if ((flags and $10000)=0) then
|
||||
@ -353,7 +352,10 @@ end;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.2 2005-02-14 17:13:30 peter
|
||||
Revision 1.3 2005-03-20 19:37:31 olle
|
||||
+ Added optional path translation mechanism
|
||||
|
||||
Revision 1.2 2005/02/14 17:13:30 peter
|
||||
* truncate log
|
||||
|
||||
Revision 1.1 2005/02/07 21:30:12 peter
|
||||
|
@ -63,6 +63,11 @@ procedure Yield;
|
||||
procedure SetDefaultMacOSFiletype(ftype: ShortString);
|
||||
procedure SetDefaultMacOSCreator(creator: ShortString);
|
||||
|
||||
var
|
||||
{Whether unix and dos style paths should be translated. Default false}
|
||||
pathTranslation: Boolean;
|
||||
|
||||
|
||||
{*********************************}
|
||||
{** Available features on macos **}
|
||||
{*********************************}
|
||||
@ -464,7 +469,6 @@ begin
|
||||
{$WARNING To be implemented - using GetProcessInformation???}
|
||||
end;
|
||||
|
||||
|
||||
var
|
||||
resHdl: Mac_Handle;
|
||||
isFolder, hadAlias, leafIsAlias: Boolean;
|
||||
@ -500,6 +504,7 @@ begin
|
||||
|
||||
StackLength := InitialStkLen;
|
||||
StackBottom := SPtr - StackLength;
|
||||
pathTranslation:= false;
|
||||
|
||||
{ Setup working directory }
|
||||
if StandAlone <> 0 then
|
||||
@ -554,7 +559,10 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.30 2005-02-14 17:13:30 peter
|
||||
Revision 1.31 2005-03-20 19:37:31 olle
|
||||
+ Added optional path translation mechanism
|
||||
|
||||
Revision 1.30 2005/02/14 17:13:30 peter
|
||||
* truncate log
|
||||
|
||||
Revision 1.29 2005/02/07 21:30:12 peter
|
||||
|
Loading…
Reference in New Issue
Block a user