It's really annoying when find(1) descends into a .snapshot directory.
Here's a patch against GNU findutils 4.1 tested under Linux and Solaris to fix the problem. It still allows descent into .snapshot, but only if .snapshot is specifically listed on the command line. GNU findutils is available at URL:ftp://prep.ai.mit.edu/pub/gnu.
Dan
--- findutils-4.1/find/find.c~ Wed Oct 12 14:21:11 1994 +++ findutils-4.1/find/find.c Sun Feb 15 17:21:29 1998 @@ -38,6 +38,10 @@ #define lstat stat #endif
+#ifndef S_IRWXUGO +#define S_IRWXUGO (S_IRWXU|S_IRWXG|S_IRWXO) +#endif + int lstat (); int stat ();
@@ -390,8 +394,11 @@ apply_predicate (pathname, &stat_buf, eval_tree);
if (stop_at_current_level == false) - /* Scan directory on disk. */ - process_dir (pathname, name, strlen (pathname), &stat_buf, parent); + /* Skip over Network Appliance ".snapshot" directories. */ + if (!(!strcmp(name, ".snapshot") && (stat_buf.st_uid == 0) && + (stat_buf.st_gid == 0) && ((stat_buf.st_mode & 0777) == S_IRWXUGO))) + /* Scan directory on disk. */ + process_dir (pathname, name, strlen (pathname), &stat_buf, parent);
if (do_dir_first == false && curdepth >= mindepth) apply_predicate (pathname, &stat_buf, eval_tree);