Source code of Windows XP (NT5)
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.

24 lines
484 B

  1. $rootdir = $ARGV[0];
  2. $lastbuild = 0;
  3. if ( ! $rootdir )
  4. {
  5. print "Usage: GetLastBuildDir.pl <Parent Archive Directory>\n";
  6. }
  7. else
  8. {
  9. if ( ! opendir( INPUTDIR, $rootdir ) )
  10. {
  11. print "Error opening directory $rootdir: $!\n";
  12. }
  13. else
  14. {
  15. while( $dir = readdir( INPUTDIR ) )
  16. {
  17. ( $dir =~ /Build(\d+.*)/ ) && ( $1 > $lastbuild ) && ( $lastbuild = $1 );
  18. }
  19. closedir INPUTDIR;
  20. print "Last build = $lastbuild\n";
  21. }
  22. }
  23. exit $lastbuild;