Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
1.5 KiB

  1. @echo off
  2. REM fileloop numfiles chunksize chunkdelay deleteoffset
  3. if "%1"=="" (
  4. echo fileloop numfiles chunksize chunkdelay deleteoffset
  5. echo numfiles - total number of files to generate
  6. echo chunksize - number of files to generate between delays
  7. echo chunkdelay - delay in seconds between chunks
  8. echo deleteoffset - point in file generation where deletes can start
  9. echo deletes are also done in chunks with the same chunk delay.
  10. goto QUIT
  11. )
  12. set NUMFILES=%1
  13. set CHUNKSZ=10
  14. if NOT "%2"=="" set CHUNKSZ=%2
  15. set CHUNKDLY=10
  16. if NOT "%3"=="" set CHUNKDLY=%3
  17. set DELOFFS=0
  18. if NOT "%4"=="" set DELOFFS=%4
  19. set /a "fx=0"
  20. set /a "ichunk=%CHUNKSZ%"
  21. set /a "delstart=0"
  22. FOR /l %%x IN (1,1,%NUMFILES%) DO (
  23. set /a "fx=%%x"
  24. set number=0000000!fx!
  25. set fname=Test!number:~-7!
  26. echo cre !fname!
  27. echo "!fname!" > !fname!
  28. if %DELOFFS% NEQ 0 (
  29. if !fx! GTR %DELOFFS% (
  30. set /a "delstart=delstart+1"
  31. set number=0000000!delstart!
  32. set fname=Test!number:~-7!
  33. echo del !fname!
  34. del !fname!
  35. )
  36. )
  37. set /a "ichunk=ichunk-1"
  38. if !ichunk! LEQ 0 (
  39. set /a "ichunk=%CHUNKSZ%"
  40. sleep %CHUNKDLY%
  41. )
  42. )
  43. rem
  44. rem Clean up left over files.
  45. rem
  46. if %DELOFFS% EQU 0 goto QUIT
  47. set /a "delstart=delstart+1"
  48. FOR /L %%x IN (!delstart!,1,!fx!) DO (
  49. set number=0000000%%x
  50. set fname=Test!number:~-7!
  51. echo del !fname!
  52. del !fname!
  53. )
  54. :QUIT