/opt/dedrads/perl/IMH
NameSizeModeActions
CPanel/-0555rm
ShowConns/-0555rm
Bytes.pm11780555editdlrm
MountPoint.pm11780555editdlrm
OptionParser.pm105960555editdlrm
Progress.pm51300555editdlrm
Shell.pm22070555editdlrm
Terminal.pm20980555editdlrm
Edit: /opt/dedrads/perl/IMH/MountPoint.pm (1178B)
#!/usr/bin/perl # encoding: utf-8 # # author: Kyle Yetter # package IMH::MountPoint; use strict; use warnings; use File::Basename; require Exporter; our @ISA = qw( Exporter ); our %EXPORT_TAGS = ( 'all' => [ qw( is_mount_point ) ] ); our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); our @EXPORT = qw( is_mount_point ); our $VERSION = '0.1'; sub is_mount_point { my $path = shift or die "need a directory argument"; unless ( -d $path ) { return 0; } my $path_device = ( stat( $path ) )[ 0 ]; my $parent_device = ( stat( dirname( $path ) ) )[ 0 ]; return( $path_device != $parent_device ); } 1; __END__ =head1 NAME IMH::MountPoint - Utilities to check whether a directory is a mount point =head1 SYNOPSIS use IMH::MountPoint; unless ( is_mount_point( "/backup" ) ) { system( "mount", "/backup" ); } =head1 AUTHOR Kyle Yetter, Ekyley@inmotionhosting.com =head1 COPYRIGHT AND LICENSE Copyright (C) 2011 by Kyle Yetter. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available. =cut