Perl Cd Bookshelf [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Perl Cd Bookshelf [Electronic resources] - نسخه متنی

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید










32.9. Cwd



use Cwd;
$dir = getcwd(); # Where am I?
use Cwd 'chdir';
chdir "/tmp"; # Updates $ENV{PWD}.
use Cwd 'realpath';
print realpath("/usr////spool//mqueue/../");
# prints /var/spool



The Cwd module provides platform-independent
functions to determine your process's current working directory. This
is better than shelling out to pwd(1)
because non-POSIX-conforming systems aren't guaranteed to have such a
command, and Perl runs on more than just POSIX platforms. The
getcwd function, which is exported by default,
returns the current working directory using whatever mechanism is
deemed safest on the current platform. If you import the
chdir function, it overrides the built-in operator
with the module's operator, which maintains the
$ENV{PWD} environment variable; commands you might
launch later that would care about that variable would then have a
consistent view of their world. The realpath
function resolves its pathname argument of any symbolic links and
relative-path components to return a full path directory in canonical
form, just like realpath(3).






/ 875