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