hedgewars/uUtils.pas
branchhedgeroid
changeset 5932 5164d17b6374
parent 5661 45618bdce725
parent 5831 80f2a44becea
child 6444 eddc1e9bcd81
equal deleted inserted replaced
5828:667fb58d7f18 5932:5164d17b6374
   340 {$IFDEF MOBILE}
   340 {$IFDEF MOBILE}
   341     {$IFDEF IPHONEOS} Assign(f,'../Documents/hw-' + cLogfileBase + '.log'); {$ENDIF}
   341     {$IFDEF IPHONEOS} Assign(f,'../Documents/hw-' + cLogfileBase + '.log'); {$ENDIF}
   342     {$IFDEF ANDROID} Assign(f,pathPrefix + '/' + cLogfileBase + '.log'); {$ENDIF}
   342     {$IFDEF ANDROID} Assign(f,pathPrefix + '/' + cLogfileBase + '.log'); {$ENDIF}
   343     Rewrite(f);
   343     Rewrite(f);
   344 {$ELSE}
   344 {$ELSE}
   345     if (ParamStr(1) <> '') and (ParamStr(2) <> '') then
   345     if (UserPathPrefix <> '') then
   346         if (ParamCount <> 3) and (ParamCount <> cDefaultParamNum) then
       
   347         begin
       
   348             i:= 0;
       
   349             while(i < 7) do
       
   350             begin
       
   351                 assign(f, ExtractFileDir(ParamStr(2)) + '/' + cLogfileBase + inttostr(i) + '.log');
       
   352                 rewrite(f);
       
   353                 if IOResult = 0 then break;
       
   354                 inc(i)
       
   355             end;
       
   356             if i = 7 then f:= stderr; // if everything fails, write to stderr
       
   357         end
       
   358         else
       
   359         begin
   346         begin
   360             i:= 0;
   347             i:= 0;
   361             while(i < 7) do
   348             while(i < 7) do
   362             begin
   349             begin
   363                 assign(f, UserPathPrefix + '/Logs/' + cLogfileBase + inttostr(i) + '.log');
   350                 assign(f, UserPathPrefix + '/Logs/' + cLogfileBase + inttostr(i) + '.log');