--- kdelibs-3.3.0/kio/kio/kdirwatch.cpp-- 2004-09-06 04:33:02.499276411 -0400 +++ kdelibs-3.3.0/kio/kio/kdirwatch.cpp 2004-09-06 04:35:26.583334633 -0400 @@ -1450,6 +1450,36 @@ KDirWatch::Method KDirWatch::internalMet return KDirWatch::Stat; } +#include <stdio.h> +#include <mntent.h> +#include <string.h> +bool KDirWatchPrivate::dir_isRO(const QString & _path ) +{ + int s = 0; + FILE *mnt = setmntent(_PATH_MOUNTED, "r"); + struct mntent *ent; + int ret = -1; + + if (mnt != NULL) { + ent = getmntent(mnt); + while (ent) { + int l = strlen(ent->mnt_dir); + + if (!strncmp(ent->mnt_dir, _path.latin1(), l)) { + if (l > s) { + s = l; + ret = (hasmntopt(ent, MNTOPT_RO) != NULL); + kdDebug()<<" ent->mnt_dir :"<<ent->mnt_dir<<" l "<<l<<endl; + } + } + ent = getmntent(mnt); + } + endmntent(mnt); + } + return ret; +} + + #include "kdirwatch.moc" #include "kdirwatch_p.moc" --- kdelibs-3.3.0/kio/kio/kdirwatch_p.h-- 2004-09-06 04:33:13.850281300 -0400 +++ kdelibs-3.3.0/kio/kio/kdirwatch_p.h 2004-09-06 04:39:12.498411078 -0400 @@ -61,6 +61,7 @@ public: bool dirty; void propagate_dirty(); + #ifdef HAVE_FAM FAMRequest fr; @@ -119,7 +120,7 @@ public: bool rescan_all; QTimer rescan_timer; - + bool dir_isRO(const QString & _path ); #ifdef HAVE_FAM QSocketNotifier *sn; FAMConnection fc;