Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/movie_player/scripts/data.genlist.pl @ 4217

Last change on this file since 4217 was 4217, checked in by bensch, 19 years ago

orxonox/branches/movie_player: merged the trunk back into the movie_player
merged with command:
svn merge -r 4014:HEAD ../trunk/ movie_player/
no conflicts

  • Property svn:executable set to *
File size: 1.7 KB
Line 
1#!/usr/bin/perl
2##########################################################################
3#   orxonox - the future of 3D-vertical-scrollers                        #
4#                                                                        #
5#   Copyright (C) 2004 orx                                               #
6#                                                                        #
7#   This program is free software; you can redistribute it and/or modify #
8#   it under the terms of the GNU General Public License as published by #
9#   the Free Software Foundation; either version 2, or (at your option)  #
10#   any later version.                                                   #
11#                                                                        #
12#   ### File Specific:                                                   #
13#   main-programmer: Benjamin Grauer                                     #
14#   co-programmer: ...                                                   #
15#                                                                        #
16#   This is a simple perl script, that generates a List of all files     #
17#   contained in a Folder checked out with SVN and writes into an output #
18#   file.                                                                #
19##########################################################################
20
21if (@ARGV[0] eq "-h" || $ARGV[0] eq "--help" || @ARGV != 2)
22  {
23    die ("usage: data.genlist.pl <data-directory> <output-file>\n");
24  }
25
26
27if (! -d @ARGV[0])
28  {
29    die ("@ARGV[0] is not regular Directory.\n");
30  }
31
32open(FD, "> @ARGV[1]") or die("Couldn't open @ARGV[1]\n") ;
33
34
35&createFileList(@ARGV[0]);
36
37close(FD);
38
39
40sub createFileList
41  {
42   my ($folderName) = @_;
43   my ($fullName);
44   my ($inputFile);
45   my ($printFile);
46   my (@folderList);
47
48   open(FOLDERLIST, "ls $folderName -1 |");
49   @folderList = <FOLDERLIST>;
50
51   foreach $inputFile (@folderList)
52     {
53       if ($inputFile eq "." || $inputFile eq "..")
54         {
55
56         }
57       chomp($inputFile);
58       $fullName = "$folderName/$inputFile";
59
60       $printFile = $fullName;
61       $printFile =~ s/@ARGV[0]//;
62       print FD "$printFile\n";
63       if (-d $fullName )
64         {
65           &createFileList($fullName);
66         }
67     }
68 }
Note: See TracBrowser for help on using the repository browser.