diff -ur encfs-1.5.orig/encfs/main.cpp encfs-1.5.new/encfs/main.cpp
--- encfs-1.5.orig/encfs/main.cpp	2008-08-06 08:36:13.000000000 +0200
+++ encfs-1.5.new/encfs/main.cpp	2009-11-13 16:53:14.000000000 +0100
@@ -84,6 +84,7 @@
     bool isThreaded; // true == threaded
     bool isVerbose; // false == only enable warning/error messages
     int idleTimeout; // 0 == idle time in minutes to trigger unmount
+    bool forceDetach; // true == detach fs even when files open
     const char *fuseArgv[MaxFuseArgs];
     int fuseArgc;
 
@@ -100,6 +101,7 @@
 	ss << (isThreaded ? "(threaded) " : "(UP) ");
 	if(idleTimeout > 0)
 	    ss << "(timeout " << idleTimeout << ") ";
+        if(forceDetach) ss << "(forceDetach) ";
 	if(opts->checkKey) ss << "(keyCheck) ";
 	if(opts->forceDecode) ss << "(forceDecode) ";
 	if(opts->ownerCreate) ss << "(ownerCreate) ";
@@ -139,6 +141,7 @@
 	// xgroup(usage)
 	<< _("  -v, --verbose\t\t"   "verbose: output encfs debug messages\n"
 	"  -i, --idle=MINUTES\t""Auto unmount after period of inactivity\n"
+        "  -F, --force-detach\t""Detach even with files left open\n"
 	"  --anykey\t\t"        "Do not verify correct key is being used\n"
 	"  --forcedecode\t\t"   "decode data even if an error is detected\n"
 	                  "\t\t\t(for filesystems using MAC block headers)\n")
@@ -190,6 +193,7 @@
     out->isThreaded = true;
     out->isVerbose = false;
     out->idleTimeout = 0;
+    out->forceDetach = false;
     out->fuseArgc = 0;
     out->opts->idleTracking = false;
     out->opts->checkKey = true;
@@ -214,6 +218,7 @@
 	{"fuse-debug", 0, 0, 'd'}, // Fuse debug mode
 	{"forcedecode", 0, 0, 'D'}, // force decode
 	// {"foreground", 0, 0, 'f'}, // foreground mode (no daemon)
+	{"force-detach", 0, 0, 'F'}, // force detach on idle
 	{"fuse-help", 0, 0, 'H'}, // fuse_mount usage
 	{"idle", 1, 0, 'i'}, // idle timeout
 	{"anykey", 0, 0, 'k'}, // skip key checks
@@ -235,13 +240,14 @@
 
 	// 's' : single-threaded mode
 	// 'f' : foreground mode
+        // 'F' : force detach on idle
 	// 'v' : verbose mode (same as --verbose)
 	// 'd' : fuse debug mode (same as --fusedebug)
 	// 'i' : idle-timeout, takes argument
 	// 'm' : mount-on-demand
 	// 'S' : password from stdin
 	// 'o' : arguments meant for fuse
-	int res = getopt_long( argc, argv, "HsSfvdmi:o:",
+	int res = getopt_long( argc, argv, "HsSfFvdmi:o:",
 		long_options, &option_index);
 
 	if(res == -1)
@@ -260,6 +266,9 @@
 	    // this option was added in fuse 2.x
 	    PUSHARG("-f");
 	    break;
+        case 'F':
+            out->forceDetach = true;
+            break;
 	case 'v':
 	    out->isVerbose = true;
 	    break;
@@ -675,6 +684,7 @@
 
     const int timeoutCycles = 60 * arg->idleTimeout / ActivityCheckInterval;
     int idleCycles = 0;
+    bool forceDetach = arg->forceDetach;
 
     pthread_mutex_lock( &ctx->wakeupMutex );
     
@@ -690,14 +700,16 @@
 	if(idleCycles >= timeoutCycles)
 	{
 	    int openCount = ctx->openFileCount();
-	    if( openCount == 0 && unmountFS( ctx ) )
+
+            if(openCount != 0 && !forceDetach)
+            {
+                rDebug("Cannot detach, %i files still open", openCount);
+            } else if(unmountFS(ctx))
 	    {
 		// wait for main thread to wake us up
 		pthread_cond_wait( &ctx->wakeupCond, &ctx->wakeupMutex );
 		break;
 	    }
-		
-	    rDebug("num open files: %i", openCount );
 	}
 	    
 	rDebug("idle cycle count: %i, timeout after %i", idleCycles,
