File::Mountpoint - see if a directory is a mountpoint


    use File::Mountpoint;

    if (File::Mountpoint::is_mountpoint("/foo/bar")) {


    use File::MountPoint qw( is_mountpoint );

    if (is_mountpoint("/foo/bar")) {


This module provides a single function, is_mountpoint(), that can be used to tell if a directory path on a POSIX filesystem is the point at which a volume is mounted.


Import Parameters

This module accepts symbol names to be exported to it's import method.

    use File::MountPoint qw( is_mountpoint );


  • is_mountpoint($path)

    Accepts a single scalar parameter which is the path (must be a directory) to be tested.

    This function will die if $path does not exist or is not a directory.

    Returns true on success and fails with undef in scalar context or () in list context.



This module is based on the behavior of the mountpoint utility that is included with the sysvinit package.


Miquel van Smoorenburg,, author of the sysvinit package.

Me, myself, and I.


Please contact the author directly via e-mail.


Joshua Hoblitt <>


Copyright (C) 2008 Joshua Hoblitt. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

The full text of the license can be found in the LICENSE file included with this module, or in the perlgpl Pod as supplied with Perl 5.8.1 and later.