[Home]WikiPatches/ExcludeDotFolders

UseModWiki | WikiPatches | RecentChanges | Preferences

Exclude any hidden (dotted) folders on UNIX servers for the index and links routines.

After running [index] for the first time on my wiki I saw each file twice. The reason was that on our UNIX server we are using a program for Macintosh access wich generates .rsrc folders in each folder.

Similar problems could arise with .pics folders generated by some graphics programs.

You can solve that problem very easily by just editing two lines in your wiki.pl:

sub GenerateAllPagesList {
...
#      next  if (($dir eq '.') || ($dir eq '..'));
       next if substr( $dir, 0, 1) eq '.';
...
#      next  if (($id eq '.') || ($id eq '..'));
       next if substr( $id, 0, 1) eq '.';
...
}

Contributors: DavidAndel, SunirShah, JoshJore?


This is partially implemented in 1.0. I added the first check for directories starting with '.', but left out the check for pages starting with '.', as they are possibly valid page files. (In fact one UseModWiki variant uses pages like this for configuration.) The code already requires that pages end with '.db', so the second check should not be needed. --CliffordAdams

UseModWiki | WikiPatches | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited September 23, 2007 2:23 pm by JuanmaMP (diff)
Search: