File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed
DesktopEmulator/DesktopInfrastructure
DevelopmentTools/DevToolsInfrastructure Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -117,10 +117,12 @@ bool IsFileNameValid( const string& FileName )
117
117
118
118
bool FileExists ( const string& FilePath )
119
119
{
120
- ifstream TestedFile;
121
- TestedFile.open ( FilePath );
122
-
123
- return (bool )TestedFile;
120
+ struct stat Info;
121
+
122
+ if ( stat ( FilePath.c_str (), &Info ) != 0 )
123
+ return false ;
124
+
125
+ return !(Info.st_mode & S_IFDIR);
124
126
}
125
127
126
128
// -----------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -138,10 +138,12 @@ bool IsFileNameValid( const string& FileName )
138
138
139
139
bool FileExists ( const string& FilePath )
140
140
{
141
- ifstream TestedFile;
142
- TestedFile.open ( FilePath );
143
-
144
- return (bool )TestedFile;
141
+ struct stat Info;
142
+
143
+ if ( stat ( FilePath.c_str (), &Info ) != 0 )
144
+ return false ;
145
+
146
+ return !(Info.st_mode & S_IFDIR);
145
147
}
146
148
147
149
// -----------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments