- Code:
#include <sys/types.h>
#include <sys/stat.h>
The above code is used on a desktop application for getting file info, ithere equivalents for Pocket PC and if so, does anyone know what these are .??
A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/stat.h>
#if defined(_MSC_VER)
#define stat _stat
#endif
void FILEOBJECT:: SetPath ( char* ptr)
{
FullName = ptr;
STRINGC lstr = ptr;
lstr.Lower();
lstr.ConvertBackslash();
FileName = lstr;
FilePath = lstr;
lstr.ExtractExtension();
FilePath.ExtractPath();
FileName.ExtractFileName();
if ( strstr(lstr, "lle") != 0 ) FileType = LLE;
if ( strstr(lstr, "bmp") != 0 ) FileType = BMP;
if ( strstr(lstr, "tga") != 0 ) FileType = TGA;
if ( strstr(lstr, "sav") != 0 ) FileType = SAV;
if ( strstr(lstr, "dat") != 0 ) FileType = DAT;
if ( strstr(lstr, "vat") != 0 ) FileType = VAT;
if ( strstr(lstr, "txt") != 0 ) FileType = TXT;
}
int FILEOBJECT:: DoesFileExist()// verifies the existance of a file, use SetPath first
{
if (FullName.GetString() == NULL) return false;
struct stat buf;
if ( stat(FullName, &buf) == -1) return false;
return true;
}
int len=strlen(sFilename);
if (len>=4) {
char *pExtension=&sFilename;[len-4];
if (!strcmp(".yep", pExtension))
FileType=YEP;
else
if (!strcmp(".bad", pExtension))
FileType=BAD;
//etc
}