~ubuntu-branches/ubuntu/raring/unrar-nonfree/raring-proposed

« back to all changes in this revision

Viewing changes to filefn.cpp

  • Committer: Package Import Robot
  • Author(s): Martin Meredith
  • Date: 2012-02-14 22:39:32 UTC
  • mfrom: (1.2.12)
  • mto: This revision was merged to the branch mainline in revision 22.
  • Revision ID: package-import@ubuntu.com-20120214223932-80w6cf6q639kinh4
Tags: upstream-4.1.4
ImportĀ upstreamĀ versionĀ 4.1.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
450
450
}
451
451
 
452
452
 
453
 
#ifndef SFX_MODULE
454
 
char *MkTemp(char *Name)
455
 
{
456
 
  size_t Length=strlen(Name);
457
 
  if (Length<=6)
458
 
    return(NULL);
459
 
  int Random=clock();
460
 
  for (int Attempt=0;;Attempt++)
461
 
  {
462
 
    sprintf(Name+Length-6,"%06u",(Random+Attempt)%1000000);
463
 
    Name[Length-4]='.';
464
 
    if (!FileExist(Name))
465
 
      break;
466
 
    if (Attempt==1000)
467
 
      return(NULL);
468
 
  }
469
 
  return(Name);
470
 
}
471
 
#endif
472
 
 
473
 
 
474
 
#if defined(_WIN_ALL) && !defined(SFX_MODULE)
475
 
wchar *MkTemp(wchar *Name)
476
 
{
477
 
  size_t Length=wcslen(Name);
478
 
  if (Length<=6)
479
 
    return(NULL);
480
 
  uint Random=clock();
481
 
  for (uint Attempt=0;;Attempt++)
482
 
  {
483
 
    sprintfw(Name+Length-6,7,L"%06u",(Random+Attempt)%1000000);
484
 
    Name[Length-4]='.';
485
 
    if (!FileExist(NULL,Name))
486
 
      break;
487
 
    if (Attempt==1000)
488
 
      return(NULL);
489
 
  }
490
 
  return(Name);
491
 
}
492
 
#endif
493
453
 
494
454
 
495
455
#ifndef SFX_MODULE
569
529
 
570
530
 
571
531
 
 
532
 
 
533
 
572
534
#if defined(_WIN_ALL) && !defined(_WIN_CE) && !defined(SFX_MODULE)
573
535
bool SetFileCompression(char *Name,wchar *NameW,bool State)
574
536
{