--- linuxsampler/trunk/src/network/lscpserver.cpp 2007/12/03 16:41:17 1536 +++ linuxsampler/trunk/src/network/lscpserver.cpp 2007/12/03 18:30:47 1537 @@ -26,6 +26,7 @@ #include "lscpevent.h" #if defined(WIN32) +#include #else #include #endif @@ -2517,6 +2518,18 @@ } void LSCPServer::VerifyFile(String Filename) { + #if WIN32 + WIN32_FIND_DATA win32FileAttributeData; + BOOL res = GetFileAttributesEx( Filename.c_str(), GetFileExInfoStandard, &win32FileAttributeData ); + if (!res) { + std::stringstream ss; + ss << "File does not exist, GetFileAttributesEx failed `" << Filename << "`: Error " << GetLastError(); + throw Exception(ss.str()); + } + if ( win32FileAttributeData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) { + throw Exception("Directory is specified"); + } + #else struct stat statBuf; int res = stat(Filename.c_str(), &statBuf); if (res) { @@ -2528,6 +2541,7 @@ if (S_ISDIR(statBuf.st_mode)) { throw Exception("Directory is specified"); } + #endif } /**