Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
No::Worries::Dir(3)   User Contributed Perl Documentation  No::Worries::Dir(3)

NAME
       No::Worries::Dir	- directory handling without worries

SYNOPSIS
	 use No::Worries::Dir
	     qw(dir_change dir_ensure dir_make dir_parent dir_read dir_remove);

	 # change directory
	 dir_change("/tmp");

	 # make	sure a directory exists	(not an	error if it exists already)
	 dir_ensure("/tmp/some/path", mode => oct(770));

	 # make	a directory (an	error if it exists already)
	 dir_make("/tmp/some/path", mode => oct(770));

	 # find	out the	parent directory of some path
	 $parent = dir_parent($path);
	 dir_ensure($parent);

	 # read	a directory
	 foreach $name (dir_read("/etc")) {
	     ...
	 }

	 # remove a directory
	 dir_remove("/tmp/some/path");

DESCRIPTION
       This module eases directory handling by providing convenient wrappers
       around standard directory functions. All	the functions die() on error.

FUNCTIONS
       This module provides the	following functions (none of them being
       exported	by default):

       dir_change(PATH)
	   change the working directory	to the given path; this	is a safe thin
	   wrapper on top of chdir()

       dir_ensure(PATH[, OPTIONS])
	   make	sure the given path is an existing directory, creating it
	   (including its parents) if needed; supported	options:

	   o   "mode": numerical mode to use for mkdir() (default: oct(777))

       dir_make(PATH[, OPTIONS])
	   make	the given directory; this is a safe thin wrapper on top	of
	   mkdir(); supported options:

	   o   "mode": numerical mode to use for mkdir() (default: oct(777))

       dir_parent(PATH)
	   return the parent directory of the given path

       dir_read(PATH)
	   read	the given directory and	return its list	of entries except "."
	   and ".."

       dir_remove(PATH)
	   remove the given directory (that must exist and be empty); this is
	   a safe thin wrapper on top of rmdir()

SEE ALSO
       No::Worries.

AUTHOR
       Lionel Cons <http://cern.ch/lionel.cons>

       Copyright (C) CERN 2012-2019

perl v5.32.1			  2019-04-03		   No::Worries::Dir(3)

NAME | SYNOPSIS | DESCRIPTION | FUNCTIONS | SEE ALSO | AUTHOR

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=No::Worries::Dir&sektion=3&manpath=FreeBSD+13.0-RELEASE+and+Ports>

home | help