../../src/common/dynlib.cpp \
../../src/common/dynload.cpp \
../../src/common/encconv.cpp \
-../../src/common/extended.c
+../../src/common/extended.c \
+../../src/common/ffile.cpp \
+../../src/common/file.cpp \
+../../src/common/fileconf.cpp \
+../../src/common/filefn.cpp \
+../../src/common/filename.cpp \
+../../src/common/filesys.cpp \
+../../src/common/fmapbase.cpp \
+../../src/common/fs_zip.cpp
SOURCES = ../../samples/minimal/minimal.cpp \
$(BASE_CMN_SRC) \
../../src/common/effects.cpp \
../../src/common/event.cpp \
../../src/common/fddlgcmn.cpp \
-../../src/common/ffile.cpp \
-../../src/common/file.cpp \
-../../src/common/fileconf.cpp \
-../../src/common/filesys.cpp \
../../src/common/fldlgcmn.cpp \
-../../src/common/fmapbase.cpp \
../../src/common/fontcmn.cpp \
../../src/common/fontmap.cpp \
../../src/common/framecmn.cpp \
../../src/common/fs_inet.cpp \
../../src/common/fs_mem.cpp \
-../../src/common/fs_zip.cpp \
../../src/common/ftp.cpp \
../../src/common/gaugecmn.cpp \
../../src/common/gbsizer.cpp \
# Register Creator ID at: http://dev.palmos.com/creatorid/
## --------------------------------------------------------------------------
-CREATOR_ID = bapp
+CREATOR_ID = wx06
DB_TYPE = appl
DATABASE_RESET =
#endif // __GNUWIN32__
#endif // __WINDOWS__
-#if defined __VMS__
+#if defined(__VMS__)
#include <fab.h>
#endif
{
wxString path2( node->GetData() );
if (
-#if defined(__WINDOWS__) || defined(__OS2__) || defined(__VMS__) || defined (__WXMAC__)
+#if defined(__WINDOWS__) || defined(__OS2__) || defined(__VMS__) || defined(__WXMAC__)
// Case INDEPENDENT
path.CompareTo (path2, wxString::ignoreCase) == 0
#else
bool
wxFileExists (const wxString& filename)
{
+#if defined(__WXPALMOS__)
+ return false;
+#elif defined(__WIN32__) && !defined(__WXMICROWIN__)
// we must use GetFileAttributes() instead of the ANSI C functions because
// it can cope with network (UNC) paths unlike them
-#if defined(__WIN32__) && !defined(__WXMICROWIN__)
DWORD ret = ::GetFileAttributes(filename);
return (ret != (DWORD)-1) && !(ret & FILE_ATTRIBUTE_DIRECTORY);
#elif defined(__OS2__)
if ( ::DosCopy(file2, file2, overwrite ? DCPY_EXISTING : 0) != 0 )
return false;
+#elif defined(__PALMOS__)
+ // TODO with http://www.palmos.com/dev/support/docs/protein_books/Memory_Databases_Files/
+ return false;
#else // !Win32
wxStructStat fbuf;
bool
wxRenameFile (const wxString& file1, const wxString& file2)
{
-#ifndef __WXWINCE__
+#if !defined(__WXWINCE__) && !defined(__WXPALMOS__)
// Normal system call
if ( wxRename (file1, file2) == 0 )
return true;
|| defined(__DMC__) \
|| defined(__GNUWIN32__) \
|| (defined(__MWERKS__) && defined(__MSL__))
- int res = wxRemove(file);
+ int res = wxRemove(file);
#elif defined(__WXMAC__)
- int res = unlink(wxFNCONV(file));
+ int res = unlink(wxFNCONV(file));
+#elif defined(__WXPALMOS__)
+ int res = 1;
+ // TODO with VFSFileDelete()
#else
- int res = unlink(OS_FILENAME(file));
+ int res = unlink(OS_FILENAME(file));
#endif
- return res == 0;
+ return res == 0;
}
bool wxMkdir(const wxString& dir, int perm)
{
-#if defined(__WXMAC__) && !defined(__UNIX__)
- return (mkdir( wxFNCONV(dir) , 0 ) == 0);
+#if defined(__WXPALMOS__)
+ return false;
+#elif defined(__WXMAC__) && !defined(__UNIX__)
+ return (mkdir( wxFNCONV(dir) , 0 ) == 0);
#else // !Mac
const wxChar *dirname = dir.c_str();
bool wxRmdir(const wxString& dir, int WXUNUSED(flags))
{
-#ifdef __VMS__
+#if defined(__VMS__)
return false; //to be changed since rmdir exists in VMS7.x
#elif defined(__OS2__)
return (::DosDeleteDir((PSZ)dir.c_str()) == 0);
-#else
-
-#ifdef __WXWINCE__
+#elif defined(__WXWINCE__)
return (CreateDirectory(dir, NULL) != 0);
+#elif defined(__WXPALMOS__)
+ // TODO with VFSFileRename()
+ return false;
#else
return (wxRmDir(OS_FILENAME(dir)) == 0);
#endif
-
-#endif
}
// does the path exists? (may have or not '/' or '\\' at the end)
strPath << _T('.');
#endif
-#if defined(__WIN32__) && !defined(__WXMICROWIN__)
+#if defined(__WXPALMOS__)
+ return false;
+#elif defined(__WIN32__) && !defined(__WXMICROWIN__)
// stat() can't cope with network paths
DWORD ret = ::GetFileAttributes(strPath);
// Get a temporary filename, opening and closing the file.
wxChar *wxGetTempFileName(const wxString& prefix, wxChar *buf)
{
+#if wxUSE_FILE
wxString filename = wxFileName::CreateTempFileName(prefix);
if ( filename.empty() )
return NULL;
buf = MYcopystring(filename);
return buf;
+#else
+ // wxFileName::CreateTempFileName needs wxFile class enabled
+ return NULL;
+#endif
}
bool wxGetTempFileName(const wxString& prefix, wxString& buf)
{
- buf = wxFileName::CreateTempFileName(prefix);
+ buf = wxGetTempFileName(prefix);
return !buf.empty();
}
// copies into buf.
wxChar *wxGetWorkingDirectory(wxChar *buf, int sz)
{
-#ifdef __WXWINCE__
+#if defined(__WXPALMOS__)
+ // TODO ?
+ return NULL;
+#elif defined(__WXWINCE__)
return NULL;
#else
if ( !buf )
time_t WXDLLEXPORT wxFileModificationTime(const wxString& filename)
{
-#ifdef __WXWINCE__
+#if defined(__WXPALMOS__)
+ return 0;
+#elif defined(__WXWINCE__)
FILETIME creationTime, lastAccessTime, lastWriteTime;
HANDLE fileHandle = ::CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL,
0, FILE_ATTRIBUTE_NORMAL, 0);
//
wxFileKind wxGetFileKind(int fd)
{
-#if !defined (__WXWINCE__)
+#if !defined(__WXWINCE__) && !defined(__WXPALMOS__)
if (isatty(fd))
return wxFILE_KIND_TERMINAL;
#endif
-#if defined __WXWINCE__
+#if defined(__WXPALMOS__)
+ return wxFILE_KIND_UNKNOWN;
+#elif defined(__WXWINCE__)
return wxFILE_KIND_UNKNOWN;
-#elif defined __WXMSW__
+#elif defined(__WXMSW__)
switch (::GetFileType(wxGetOSFHandle(fd)) & ~FILE_TYPE_REMOTE)
{
case FILE_TYPE_DISK:
return wxFILE_KIND_UNKNOWN;
-#elif defined __UNIX__
+#elif defined(__UNIX__)
struct stat st;
fstat(fd, &st);
if (!S_ISREG(st.st_mode))
return wxFILE_KIND_UNKNOWN;
- #if defined __VMS__
+ #if defined(__VMS__)
if (st.st_fab_rfm != FAB$C_STMLF)
return wxFILE_KIND_UNKNOWN;
#endif
return ::wxGetHomeDir();
}
+#if wxUSE_FILE
+
void wxFileName::AssignTempFileName(const wxString& prefix, wxFile *fileTemp)
{
wxString tempname = CreateTempFileName(prefix, fileTemp);
}
path = dir + wxT("\\") + prefix;
int i = 1;
- while (wxFileExists(path))
+ while (FileExists(path))
{
path = dir + wxT("\\") + prefix ;
path << i;
}
#else // !HAVE_MKTEMP (includes __DOS__)
// generate the unique file name ourselves
- #if !defined(__DOS__) && (!defined(__MWERKS__) || defined(__DARWIN__) )
+ #if !defined(__DOS__) && !defined(__PALMOS__) && (!defined(__MWERKS__) || defined(__DARWIN__) )
path << (unsigned int)getpid();
#endif
{
// 3 hex digits is enough for numTries == 1000 < 4096
pathTry = path + wxString::Format(_T("%.03x"), (unsigned int) n);
- if ( !wxFile::Exists(pathTry) )
+ if ( !FileExists(pathTry) )
{
break;
}
return path;
}
+#endif // wxUSE_FILE
+
// ----------------------------------------------------------------------------
// directory operations
// ----------------------------------------------------------------------------