Bad luck for me once again...:-(
 
Check this...

eurika120:arijit>./test3.pl test3.pl
Blocksize: []
eurika120:arijit>
eurika120:arijit>
eurika120:arijit>cat test3.pl
#!/depot/qsc/VG1.0/bin/perl
use File::stat;
my $file = "$ARGV[0]";
my $st = "";
my $blocksize = 0;
$st = stat($file);
$blocksize = $st->blksize;
print "Blocksize: [$blocksize]\n";
eurika120:arijit>cat /etc/QSC
--------------------
DATE: 12172003
HOSTNAME: eurika120
ARCH: IA32
QSC: QSC-V
INSTALL: reimage
OS: RH_7.2
--------------------
eurika120:arijit>./test3.pl test.pl
Blocksize: []
eurika120:arijit>
I got what the issue is....The issue is my version of Perl. It is 5.004 which doesn't let this work...but perl5.8 etc are working pretty fine.
 
Anyways thanks a lot...
-Arijit
Jeff D <[EMAIL PROTECTED]
ahoo.com> wrote:
Try using the File::stat module...it works fine for me
on RHES and 7.2

use File::stat;

my $file = "./blah";
my $st = "";
my $blocksize = 0;

$st = stat($file);
$blocksize = $st->blksize;

print "Blocksize: [$blocksize]\n";

HTH

JD

--- Arijit Das <[EMAIL PROTECTED]>wrote:

> Thanks Bruce...Your solution was good. But
> unfortunately it doesn't seem to work on RH Linux
> 7.2 and RHAS3.0 which is what I need.
>
> Went though its documentation.....Seemed like the
> blksize field of the stat structure is not very
> portable...which is what the Linux failures
> proves...
>
> -Arijit
>
> Bruce Hudson <[EMAIL PROTECTED]>wrote:
> > Given a UNIX flavor/machine, say a Linux box, I
> need to figure out the
> > size of! the file system block of the current file
> system I am working in.
> > Generally, it is multiple of 512 but less than the
> page frame size...but
> > how can I get the exact value of my current file
> system?
>
> Simply find a file in the appropriate file system
> (the mount point will
> work or "." if naught else) and call "stat" on it.
> Element 11 of the array
> returned is the block size of the file system.
>
> $size = (stat ".")[11];
> --
> Bruce A. Hudson | [EMAIL PROTECTED]
> UCIS, Networks and Systems |
> Dalhousie University |
> Halifax, Nova Scotia, Canada | (902) 494-3405
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam
> protection around
> http://mail.yahoo.com >
_______________________________________________
> Perl-Unix-Users mailing list
> Perl-Unix-Users@listserv.ActiveState.com
> To unsubscribe:
http://listserv.ActiveState.com/mailman/mysubs




__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

_______________________________________________
Perl-Unix-Users mailing list
Perl-Unix-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to