Well, you could try a hack for OSX or other *nix. It is not elegant, and may cause other problems, but you could simply write a little script that monitors a directory for files matching your pattern and renames them to dot files. If you then run this script as a cronjob all matching files will be renamed to hidden ones. For example:
while true; do
find ~/ -name "*~" -o -name "\#*\#"| ## find files matching your pattern
while IFS= read -r n; do ## save each file as $n
d=`dirname $n`; ## $d is the directory $n was found in
b=`basename $n`; ## $b is the name of the file, no path
mv "$n" "$d/.$b"; ## rename it as a hidden file
sleep 1; ## wait one second
If you save this as
~/renamedot.sh and make it executable (
chmod a+x ~/renamedot.sh) You can then create a crontab (run
cron -e) like this:
@reboot /Users/your_user/renamedot.sh &
Now, this script will be run as a daemon and automatically rename any files matching your pattern to hidden dot files.
WARNING: This is not a good idea. The programs that generate these files and might depend on them will no longer find them since they have been renamed. For example,
M-X recover-this-file will no longer work because its backup will not be found. You could always point it to the renamed file manually of course, but it might not be so easy in other cases. So, use at your own risk.