Here's a quick solution in Perl:
#!/usr/bin/perl
use Fcntl;
my $path = "/dev/sda3";
sysopen(FH, $path, O_RDWR|O_EXCL) or die $!;
More information about formatting options
here is a solution
Here's a quick solution in Perl:
#!/usr/bin/perl
use Fcntl;
my $path = "/dev/sda3";
sysopen(FH, $path, O_RDWR|O_EXCL) or die $!;