CakeFest 2024: The Official CakePHP Conference

posix_getcwd

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

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

Açıklama

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.

add a note

User Contributed Notes 1 note

up
0
phpmanual-getcwd at devin dot com
23 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.
To Top