in reply to Re: Easy way to check if a file is open needed.
in thread Easy way to check if a file is open needed.

Hello choroba,

when I read

> The filehandle stays connected to it even if the file name changes

I said: oh what good news! But when I tried it appears to behaves differently on MSWin32: I suddendly get Permission denied at writetorenamed.pl line 13. after had printed 1 or 2 and the file get not renamed ;(

perl writetorenamed.pl Printed: 1. Printed: 2. Permission denied at writetorenamed.pl line 13. Printed: 3. Printed: 4. Printed: 5. Printed: 6. Printed: 7. Printed: 8. Printed: 9. Printed: 10. cat 1 1 2 3 4 5 6 7 8 9 10

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re^3: Easy way to check if a file is open needed. -- MSWin32
by choroba (Cardinal) on Apr 09, 2019 at 07:35 UTC
    Yes, my comment is valid only for *nix and macOS.
    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]