I need my script to get the size (Preferably in bytes) of a hard drive, I tried this: my $Size = (-s "/dev/sda4"); but it always sets $Size to 0.
Since this seems very OS-specific it may be sensible to use OS-specific tools. Anyway a module like Sys::Filesystem seems like a good start. I found it with a few seconds' CPAN search for Linux device. Other searches may return more appropriate results for you.
In reply to Re: get the size of a special device (drive)
by blazar
in thread get the size of a special device (drive)
by exodist
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |