
streamWrapper::mkdir 함수는 디렉토리를 생성할 때 사용하는 함수입니다.
streamWrapper::mkdir 함수를 사용할 때, 디렉토리 생성에 실패하는 경우는 다음과 같습니다.
- 권한이 부족한 경우
- 이미 존재하는 디렉토리 이름을 사용하는 경우
- 디스크 공간이 부족한 경우
streamWrapper::mkdir 함수의 반환값은 TRUE 또는 FALSE입니다. TRUE이면 디렉토리가 성공적으로 생성되었고, FALSE이면 생성에 실패했습니다.
streamWrapper::mkdir 함수를 사용하여 디렉토리를 생성할 때, 권한 설정은 다음과 같이 할 수 있습니다.
- stream_context_create() 함수를 사용하여 stream_context_options 배열을 생성합니다.
- stream_context_set_option() 함수를 사용하여 디렉토리 생성 권한을 설정합니다.
- streamWrapper::mkdir() 함수를 사용하여 디렉토리를 생성합니다.
예를 들어, 다음과 같이 디렉토리 생성 권한을 설정할 수 있습니다.
#hostingforum.kr
php
$opts = array(
'directory' => '/path/to/directory',
'permissions' => 0755 // 권한 설정
);
$context = stream_context_create($opts);
streamWrapper::mkdir($context);
2025-07-15 19:59