Thread Sicheres Löschen (25 answers)
Opened by bianca at 2013-04-07 09:48

topeg
 2013-04-07 17:27
#166932 #166932
User since
2006-07-10
2611 Artikel
BenutzerIn

user image
Wie ich schon schrieb, du musst halt prüfen ob die Datei noch geöffnet ist.
Code (perl): (dl )
1
2
3
4
5
6
# close ...

my %opened;
if($^O=~/linux/i)
{ %opened=map{ $_ => 1 }grep{ !/^\w+:\[?\w+\]?$/ }map{ readlink }glob( "/proc/*/fd/*" ); }
unlink $file if(-z $file and !$opened{$file});

View full thread Sicheres Löschen