+ // checks on most common flags for files/directories;
+ // more platform-specific features (like e.g. Unix permissions) are not
+ // available in wxFileName
+
+ bool IsDirWritable() const { return wxIsWritable(GetPath()); }
+ static bool IsDirWritable(const wxString &path) { return wxDirExists(path) && wxIsWritable(path); }
+
+ bool IsDirReadable() const { return wxIsReadable(GetPath()); }
+ static bool IsDirReadable(const wxString &path) { return wxDirExists(path) && wxIsReadable(path); }
+
+ // NOTE: IsDirExecutable() is not present because the meaning of "executable"
+ // directory is very platform-dependent and also not so useful
+
+ bool IsFileWritable() const { return wxIsWritable(GetFullPath()); }
+ static bool IsFileWritable(const wxString &path) { return wxFileExists(path) && wxIsWritable(path); }
+
+ bool IsFileReadable() const { return wxIsReadable(GetFullPath()); }
+ static bool IsFileReadable(const wxString &path) { return wxFileExists(path) && wxIsReadable(path); }
+
+ bool IsFileExecutable() const { return wxIsExecutable(GetFullPath()); }
+ static bool IsFileExecutable(const wxString &path) { return wxFileExists(path) && wxIsExecutable(path); }
+
+
+ // time functions
+#if wxUSE_DATETIME
+ // set the file last access/mod and creation times
+ // (any of the pointers may be NULL)
+ bool SetTimes(const wxDateTime *dtAccess,
+ const wxDateTime *dtMod,
+ const wxDateTime *dtCreate) const;
+
+ // set the access and modification times to the current moment
+ bool Touch() const;
+
+ // return the last access, last modification and create times
+ // (any of the pointers may be NULL)
+ bool GetTimes(wxDateTime *dtAccess,
+ wxDateTime *dtMod,
+ wxDateTime *dtCreate) const;
+
+ // convenience wrapper: get just the last mod time of the file
+ wxDateTime GetModificationTime() const
+ {
+ wxDateTime dtMod;
+ (void)GetTimes(NULL, &dtMod, NULL);
+ return dtMod;
+ }
+#endif // wxUSE_DATETIME
+
+#if defined( __WXOSX_MAC__ ) && wxOSX_USE_CARBON
+ bool MacSetTypeAndCreator( wxUint32 type , wxUint32 creator ) ;
+ bool MacGetTypeAndCreator( wxUint32 *type , wxUint32 *creator ) const;
+ // gets the 'common' type and creator for a certain extension
+ static bool MacFindDefaultTypeAndCreator( const wxString& ext , wxUint32 *type , wxUint32 *creator ) ;
+ // registers application defined extensions and their default type and creator
+ static void MacRegisterDefaultTypeAndCreator( const wxString& ext , wxUint32 type , wxUint32 creator ) ;
+ // looks up the appropriate type and creator from the registration and then sets
+ bool MacSetDefaultTypeAndCreator() ;
+#endif