in reply to running perl script makes my external HDD read-only

I think it has nothing to do with perl.

On Linux I can think of a scenario that can lead to such a behaviour: the file system is mounted with the option that automatically remounts the FS as ro when an error occurs. Now your script reads through the whole directory, and the file system is corrupted. An error is reported, and the FS is mounted read-only.

Of course that's just a theory. You can check that by looking at the output of the dmesg program, or by looking into various log files in /var/log/ (messages, kern.log, syslog).

Replies are listed 'Best First'.
Re^2: running perl script makes my external HDD read-only
by typically (Novice) on Aug 26, 2008 at 13:04 UTC
    You are exactly right:

    Aug 26 14:44:50 typically-desktop kernel: [ 176.616936] FAT: Filesyst +em panic (dev sdb1) Aug 26 14:44:50 typically-desktop kernel: [ 176.616944] fat_get_c +luster: invalid cluster chain (i_pos 0) Aug 26 14:44:50 typically-desktop kernel: [ 176.616951] File syst +em has been set read-only

    Solved it with a simple fsck command

    Thanks for your (non-Perl) expertise! I shall most probably return with real perl questions :)