Subversion Repositories spk

Rev

Rev 85 | Rev 102 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 85 Rev 95
Line 81... Line 81...
81
 
81
 
82
	dir = dir.FindReplace("//", "/");
82
	dir = dir.FindReplace("//", "/");
83
	return dir;
83
	return dir;
84
}
84
}
85
 
85
 
86
bool CDirIO::IsDir(CyString dir)
86
bool CDirIO::IsDir(CyString sDir)
87
{
87
{
88
	dir = ParseDir(dir);
88
	Utils::String dir = parseDir(sDir.ToString());
89
	if ( ACCESS( dir.c_str(), 0 ) == 0 )
89
	if ( ACCESS( dir.c_str(), 0 ) != -1 )
90
	{
90
	{
91
		struct stat status;
91
		struct stat status;
92
		stat( dir.c_str(), &status );
92
		stat( dir.c_str(), &status );
93
 
93
 
94
		if ( status.st_mode & S_IFDIR )
94
		if ( status.st_mode & S_IFDIR )
95
			return true;
95
			return true;
-
 
96
	}
-
 
97
	else {
-
 
98
		return !dir.token("/", -1).isin(".");
96
	}
99
	}
97
 
100
 
98
	return false;
101
	return false;
99
}
102
}
100
 
103
 
101
bool CDirIO::IsFile(CyString dir)
104
bool CDirIO::IsFile(CyString sDir)
102
{
105
{
103
	dir = ParseDir(dir);
106
	Utils::String dir = parseDir(sDir.ToString());
104
	if ( ACCESS( dir.c_str(), 0 ) == 0 )
107
	if ( ACCESS( dir.c_str(), 0 ) != -1 )
105
	{
108
	{
106
		struct stat status;
109
		struct stat status;
107
		stat( dir.c_str(), &status );
110
		stat( dir.c_str(), &status );
108
 
111
 
109
		if ( status.st_mode & S_IFDIR )
112
		if ( status.st_mode & S_IFDIR )
110
			return false;
113
			return false;
111
		else
114
		else
112
			return true;
115
			return true;
-
 
116
	}
-
 
117
	else {
-
 
118
		return dir.token("/", -1).isin(".");
113
	}
119
	}
114
 
120
 
115
	return false;
121
	return false;
116
}
122
}
117
 
123