Example #1
0
// Used by download and upload
std::string
gtBaseOpts::processOption_Path ()
{
    if (m_vm.count (OPT_PATH) < 1)
    {
        return "";    
    }

    std::string path = sanitizePath (m_vm[OPT_PATH].as<std::string>());

    if (path.size() == 0)
    {
        commandLineError ("command line or config file contains no value for '"
                          OPT_PATH "'");
    }

    relativizePath (path);

    if (statDirectory (path) != 0)
    {
        commandLineError ("unable to opening directory '" + path + "'");
    }

    return path;
}
Example #2
0
void
gtBaseOpts::processOption_ResourceDir ()
{
#ifdef __CYGWIN__
    m_resourceDir = getWinInstallDirectory ();
#endif /* __CYGWIN__ */

    if (m_vm.count (OPT_RESOURCE_DIR) == 1)
    {
        m_resourceDir = sanitizePath (m_vm[OPT_RESOURCE_DIR].as<std::string>());
    }
    else   // command line (or config file) option not present
    {
        char *envValue = getenv ("GT_RESOURCE_DIR");

        if (envValue != NULL)
        {
            m_resourceDir = sanitizePath (envValue) + "/";
        }
        else   // No environment variable for the resource path
        {
            return;
        }
    }

    if (statDirectory (m_resourceDir) != 0)
    {
        commandLineError ("unable to open resource directory '" + m_resourceDir + "'");
    }
}
static int
inodeFoundInParent(struct directory *parent, ino_t inode, dev_t device)
{
	while (parent) {
		if (!parent->stat && statDirectory(parent) < 0)
			return -1;
		if (parent->inode == inode && parent->device == device) {
			g_debug("recursive directory found");
			return 1;
		}
		parent = parent->parent;
	}

	return 0;
}
Example #4
0
static int
inodeFoundInParent(struct directory *parent, ino_t inode, dev_t device)
{
#ifndef G_OS_WIN32
	while (parent) {
		if (!parent->stat && statDirectory(parent) < 0)
			return -1;
		if (parent->inode == inode && parent->device == device) {
			g_debug("recursive directory found");
			return 1;
		}
		parent = parent->parent;
	}
#else
	(void)parent;
	(void)inode;
	(void)device;
#endif

	return 0;
}