if(BUILD_EXAMPLES)
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/../taglib
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/toolkit
+ ${CMAKE_CURRENT_SOURCE_DIR}/../taglib/ape
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpeg
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpeg/id3v1
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpeg/id3v2
#include <iostream>
#include <stdlib.h>
-#include <unistd.h>
#include <tbytevector.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <unistd.h>
#include <stdlib.h>
#include <tlist.h>
bool isFile(const char *s)
{
struct stat st;
+#ifdef _WIN32
+ return ::stat(s, &st) == 0 && (st.st_mode & (S_IFREG));
+#else
return ::stat(s, &st) == 0 && (st.st_mode & (S_IFREG | S_IFLNK));
+#endif
}
void usage()
// characters. Also make sure that there is data in the frame.
if(!frameID.size() == (version < 3 ? 3 : 4) ||
- header->frameSize() <= (header->dataLengthIndicator() ? 4 : 0) ||
+ header->frameSize() <= uint(header->dataLengthIndicator() ? 4 : 0) ||
header->frameSize() > data.size())
{
delete header;
#ifdef _WIN32
- file = _wfopen(name, L"rb+");
+ if(wcslen((const wchar_t *) fileName) > 0) {
- if(file)
- readOnly = false;
- else
- file = _wfopen(name, L"rb");
+ file = _wfopen(name, L"rb+");
- if(file)
- return;
+ if(file)
+ readOnly = false;
+ else
+ file = _wfopen(name, L"rb");
+
+ if(file)
+ return;
+
+ }
#endif
+ debug("trying ot use char");
file = fopen(name, "rb+");
if(file)