#!/usr/bin/perl use strict; use warnings; $| = 1; use File::Find; use Text::CSV; # Verzeichnis von Kommandozeile holen my $verzeichnis = shift(@ARGV) || 'C:\Users\Ordner'; my $csv_name = shift(@ARGV) || 'C:\Users\AAA\Desktop\dir.csv'; my $id = 0; my $parent; my %ids; my $csv=Text::CSV->new(); open(my $cvsfh,'>',$csv_name) or die("ERROR open $csv_name $!\n"); print $cvsfh "#fullname,name,size,id,pid,mtime\n"; sub wanted { return if ( $_ eq '..' ); return if ( $_ eq '.' ); $ids{ $File::Find::name } = $id; $parent = $File::Find::dir; $csv->print ($cvsfh, [ $File::Find::name, $_, (stat($File::Find::name))[7], $ids{ $parent }, (stat($File::Find::name))[9], ]); }