سلام
چگونه می توانم مسیر یک فایل در روی یک سرور unix را با php تعیین کنم
متشکرم
سلام
چگونه می توانم مسیر یک فایل در روی یک سرور unix را با php تعیین کنم
متشکرم
توابع filesystem را از مرجع php ببینید توابع مربوط به سئوال شما را برایتان می گذارم
FILE Function
copy
Copies file (PHP 3, PHP 4 )
bool copy ( string source, string dest )
rename
Renames a file (PHP 3, PHP 4 )
bool rename ( string oldname, string newname )
unlink
Deletes a file (PHP 3, PHP 4 )
bool unlink ( string filename )
mkdir
Makes directory (PHP 3, PHP 4 )
bool mkdir ( string pathname [, int mode] )
rmdir
Removes directory (PHP 3, PHP 4 )
bool rmdir ( string dirname )
Other:
is_dir
Tells whether the filename is a directory (PHP 3, PHP 4 )
bool is_dir ( string filename )
is_file
Tells whether the filename is a regular file (PHP 3, PHP 4 )
bool is_file ( string filename )
is_readable
Tells whether the filename is readable (PHP 3, PHP 4 )
bool is_readable ( string filename )
is_writable
Tells whether the filename is writable (PHP 4 )
bool is_writable ( string filename )
شما بوسیله این توابع می توانید یک دایرکتوری جدید بسازید و فایل های خود را در آن کپی کنید
یک مثال را که شاید به دردتان بخورد هم برایتان می گذارم
<?php
$path = "/etc/passwd";
$file = dirname ($path); // $file is set to "/etc"
?>
Artists use lies to tell the truth while politicians use them to cover the truth up
سلام
خیلی متشکرم
دستور آخری که نوشتید چه کاری انجام می دهد؟
dirname
Returns directory name component of path (PHP 3, PHP 4 )
string dirname ( string path )
Given a string containing a path to a file, this function will return the name of the directory.
On Windows, both slash (/) and backslash (\) are used as path separator character. In other environments, it is the forward slash (/).
عزیزم این فقط یک مثال بود.ولی توضیح تابع را برایتان گذاشتم کاملترین توضیحات را در مرجعی که بارها به شما معرفی کردم بخوانید :oops:
راستی شاید اگر از این تابع در ویندوز استفاده کنید بیشتر متوجه کارش شوید :D
Artists use lies to tell the truth while politicians use them to cover the truth up
سلام
خیلی متشکرم
آن منبعی را که می گویید به علت حجم زیاد و مشکلات دیگر هنوز نتوانستم دانلود کنم :oops:
من روزی چند بار به جان پدید آورندگان آن دعا میکنم :lol:
می توانید بوسیله دانلود منیجر ها آن را تکه تکه دانلود کنید زیرا سرورش resume را ساپورت می کند
Artists use lies to tell the truth while politicians use them to cover the truth up