phpday 2027 - Call for Papers

posix_getcwd

(PHP 4, PHP 5, PHP 7, PHP 8)

posix_getcwd — Çalışılan dizinin tam yolunu döndürür

Açıklama

function posix_getcwd(): string|false

Betiğin çalışma dizininin mutlak yolunu döndürür. Hata durumunda atanan hata numarasına posix_get_last_error() işlevi ile erişilebilir.

Bağımsız Değişkenler

Bu işlevin bağımsız değişkeni yoktur.

Dönen Değerler

İşlem sırasında bir hata oluşursa posix_get_last_error() işlevi ile öğrenilmek üzere bir hata numarası atanır ve false döner, yoksa mutlak dizin yolunu içeren bir dizge döner.

Örnekler

Örnek 1 - posix_getcwd() örneği

Bu örnek, betiğin çalıştığı dizinin tam yolunu göstermektedir.

<?php
echo 'Çalışma dizinim: '.posix_getcwd();
?>

Notlar

Bilginize:

  • Okuma ve arama izni yoksa

  • veya mutlak yol artık mevcut değilse

bu işlev başarısız olur.

User Contributed Notes 1 note

up
0
phpmanual-getcwd at devin dot com
26 years ago
From the GNU getcwd(3) manpage, paraphrased: returns the absolute pathname of the current working directory.  Fails when the current directory is not eradable.  Complies with POSIX.1 spec.
Adding new notes is disabled. Please see the links in the Found A Problem? section.
To Top