ftp_chdir - FTP 서버의 현재 디렉토리를 변경
ftp_chdir - FTP 서버의 현재 디렉토리를 변경
설명 ¶
bool ftp_chdir ( resource $ftp_stream , string $directory )
현재 디렉토리를 지정된 디렉토리로 변경합니다.
매개 변수 ¶
ftp_stream
FTP 연결의 링크 식별자입니다.
directory
대상 디렉토리.
값을 돌려줍니다 ¶
반환 값 TRUE성공 또는 FALSE실패. 디렉토리 변경이 실패하면 PHP는 경고를 발생시킵니다.
예 ¶
예 # 1 ftp_chdir () 예
<?php
// set up basic connection
$conn_id = ftp_connect($ftp_server);
// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
// check connection
if ((!$conn_id) || (!$login_result)) {
die("FTP connection has failed !");
}
echo "Current directory: " . ftp_pwd($conn_id) . "\n";
// try to change the directory to somedir
if (ftp_chdir($conn_id, "somedir")) {
echo "Current directory is now: " . ftp_pwd($conn_id) . "\n";
} else {
echo "Couldn't change directory\n";
}
// close the connection
ftp_close($conn_id);
?>
설명 ¶
bool ftp_chdir ( resource $ftp_stream , string $directory )
현재 디렉토리를 지정된 디렉토리로 변경합니다.
매개 변수 ¶
ftp_stream
FTP 연결의 링크 식별자입니다.
directory
대상 디렉토리.
값을 돌려줍니다 ¶
반환 값 TRUE성공 또는 FALSE실패. 디렉토리 변경이 실패하면 PHP는 경고를 발생시킵니다.
예 ¶
예 # 1 ftp_chdir () 예
<?php
// set up basic connection
$conn_id = ftp_connect($ftp_server);
// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
// check connection
if ((!$conn_id) || (!$login_result)) {
die("FTP connection has failed !");
}
echo "Current directory: " . ftp_pwd($conn_id) . "\n";
// try to change the directory to somedir
if (ftp_chdir($conn_id, "somedir")) {
echo "Current directory is now: " . ftp_pwd($conn_id) . "\n";
} else {
echo "Couldn't change directory\n";
}
// close the connection
ftp_close($conn_id);
?>
게시판 목록
개발자팁
개발과 관련된 유용한 정보를 공유하세요.
질문은 QA에서 해주시기 바랍니다.
질문은 QA에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 5246 | node.js |
swallow
|
2년 전 | 1105 | |
| 5245 | PHP |
swallow
|
2년 전 | 2528 | |
| 5244 | PHP |
swallow
|
2년 전 | 1286 | |
| 5243 | JavaScript |
swallow
|
2년 전 | 685 | |
| 5242 | node.js |
swallow
|
2년 전 | 666 | |
| 5241 | node.js |
swallow
|
2년 전 | 778 | |
| 5240 | MySQL |
swallow
|
2년 전 | 808 | |
| 5239 | MySQL | 2년 전 | 784 | ||
| 5238 | JavaScript | 2년 전 | 983 | ||
| 5237 | 웹서버 |
swallow
|
2년 전 | 3989 | |
| 5236 | PHP |
swallow
|
2년 전 | 899 | |
| 5235 | PHP |
swallow
|
2년 전 | 1378 | |
| 5234 | 기타 | 2년 전 | 761 | ||
| 5233 | jQuery |
swallow
|
2년 전 | 2036 | |
| 5232 | 2년 전 | 618 | |||
| 5231 | 2년 전 | 1173 | |||
| 5230 | 2년 전 | 1076 | |||
| 5229 | PHP |
swallow
|
2년 전 | 1023 | |
| 5228 | MySQL | 2년 전 | 726 | ||
| 5227 | PHP |
swallow
|
2년 전 | 837 | |
| 5226 | PHP |
swallow
|
2년 전 | 1811 | |
| 5225 | PHP | 2년 전 | 576 | ||
| 5224 | node.js |
swallow
|
2년 전 | 4083 | |
| 5223 | PHP |
swallow
|
2년 전 | 1317 | |
| 5222 | 기타 |
techstar
|
2년 전 | 563 | |
| 5221 | PHP | 2년 전 | 652 | ||
| 5220 |
swallow
|
2년 전 | 905 | ||
| 5219 | 2년 전 | 881 | |||
| 5218 | 2년 전 | 523 | |||
| 5217 | 2년 전 | 1001 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기