Pchp.Library.Streams.FileStreamWrapper.RemoveDirectory C# (CSharp) Method

RemoveDirectory() public method

public RemoveDirectory ( string path, StreamRemoveDirectoryOptions options, StreamContext context ) : bool
path string
options StreamRemoveDirectoryOptions
context StreamContext
return bool
        public override bool RemoveDirectory(string path, StreamRemoveDirectoryOptions options, StreamContext context)
        {
            try
            {
                // Deletes the directory (but not the contents - must be empty)
                Directory.Delete(path, false);
                return true;
            }
            catch (UnauthorizedAccessException)
            {
                PhpException.Throw(PhpError.Warning, ErrResources.stream_file_access_denied, FileSystemUtils.StripPassword(path));
            }
            catch (IOException)
            {
                // Directory not empty.
                PhpException.Throw(PhpError.Warning, ErrResources.stream_rmdir_io_error, FileSystemUtils.StripPassword(path));
            }
            return false;
        }