perl -e"open F, '<', $ARGV[0] or die $!; while(1){ print ; -e $ARGV[0] or die 'The file went away'; Win32::Sleep 100 }" file