GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  NO::WORRIES::DIR (3)

.ds Aq ’

NAME

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

CONTENTS

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-2013

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 NO::WORRIES::DIR (3) 2013-05-21

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.