dir-posix.cpp revision 5536bf5807d906c24745c0c56b06575c4b60c842
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk * IPRT - Directory manipulation, POSIX.
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk * Copyright (C) 2006-2010 Sun Microsystems, Inc.
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk * This file is part of VirtualBox Open Source Edition (OSE), as
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk * available from http://www.virtualbox.org. This file is free software;
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk * you can redistribute it and/or modify it under the terms of the GNU
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk * General Public License (GPL) as published by the Free Software
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk * Foundation, in version 2 as it comes in the "COPYING" file of the
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk * The contents of this file may alternatively be used under the terms
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk * of the Common Development and Distribution License Version 1.0
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk * VirtualBox OSE distribution, in which case the provisions of the
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk * CDDL are applicable instead of those of the GPL.
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk * You may elect to license modified versions of this file under the
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk * terms and conditions of either the GPL or the CDDL or both.
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <dirent.h>
#include <stdio.h>
#if !defined(RT_OS_SOLARIS)
bool fRc = false;
char *pszNativePath;
struct stat s;
return fRc;
int rc;
char *pszNativePath;
#ifdef RT_OS_SOLARIS
return rc;
char *pszNativePath;
return rc;
int rc;
if (fd >= 0)
return rc;
char *pszNativePath;
return rc;
if (!pDir)
return VERR_INVALID_PARAMETER;
return VERR_INVALID_PARAMETER;
return rc;
if (rc)
return rc;
if (!pResult)
return VERR_NO_MORE_FILES;
#ifndef RT_DONT_CONVERT_FILENAMES
return rc;
return VINF_SUCCESS;
#ifdef HAVE_DIRENT_D_TYPE
switch (iType)
return RTDIRENTRYTYPE_UNKNOWN;
return VERR_INVALID_PARAMETER;
if (pcbDirEntry)
#ifdef RT_DONT_CONVERT_FILENAMES
if (pcbDirEntry)
#ifdef HAVE_DIRENT_D_TYPE
#ifndef RT_DONT_CONVERT_FILENAMES
return rc;
switch (enmType)
RTDECL(int) RTDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags)
return VERR_INVALID_PARAMETER;
if (pcbDirEntry)
#ifdef RT_DONT_CONVERT_FILENAMES
if (pcbDirEntry)
if (pszNamePath)
#ifdef HAVE_DIRENT_D_TYPE
#ifndef RT_DONT_CONVERT_FILENAMES
return rc;
AssertMsgReturn(!(fRename & ~RTPATHRENAME_FLAGS_REPLACE), ("%#x\n", fRename), VERR_INVALID_PARAMETER);
return rc;