#!/usr/bin/perl

###########################
### Autor: Sebastian Enger / B.Sc. 
### Copyright: Sebastian Enger
### Licence: BSD
### Version: 1.1.b  - 20080716@19.Uhr
### Contact: sebastian.enger@gmail.com | icq: 135846444
### Latest Version: PENDRIVE:\Programming\Perl\IncrementalBackup
###########################

use strict;
use File::Find;	# perl -MCPAN -e 'force install "File::Find"'
use File::Copy;	# perl -MCPAN -e 'force install "File::Copy"'
use File::Path;	# perl -MCPAN -e 'force install "File::Path"'
# use File::Remove qw(remove);



my $SourceFolder = 'I:\Working 2013\www.onetopp.com\Recherche\1. Version';
my $LogfileFolder = 'I:\Working 2013\www.onetopp.com\Recherche\1. Version\filelist_version1.txt';

# prepare files from SourceFolder
find(\&SourceStructure, $SourceFolder);


sub SourceStructure(){

    # $_ is set to the current file name
    # $File::Find::dir is set to the current directory
    # $File::Find::name is set to "$File::Find::dir/$_"
    # you are chdir()'d to $File::Find::dir 

	my $SourceFilename		= $File::Find::name;
	my $SourceDirname		= $File::Find::dir;
	my $file 				= $_;
	
#if ( $SourceFilename =~ /\.(swf)$/ig && $SourceDirname =~ /[a-z]/ig){	
	
		open(W,"+>>$LogfileFolder");
		#print $SourceFilename."\n";
		print W "$SourceFilename\n";
		close W;	
}; # sub SourceStructure(){