Tuesday, August 18, 2009 at 7:32 PM.

newsRiverSuite.podcatcher.cleanFilename

on cleanFilename (fname) {
	<<Changes
		<<9/19/05; 5:45:19 PM by DW
			<<Legal characters for DOS file names include the following:
			<<Upper case letters A-Z 
			<<Numbers 0-9 
			<<Space (though trailing spaces are considered to be padding and not a part of the file name) 
			<<! # $ % & ( ) - @ ^ _ ` { } ~ ' 
			<<Values 128-255 
	if system.environment.isWindows {
		local (i, ch, fllegal, s="");
		for i = 1 to sizeof (fname) {
			ch = fname [i];
			fllegal = true;
			if not string.isalpha (ch) {
				if not string.isnumeric (ch) {
					if (number (char (ch)) < 128) {
						if not ({' ', '!', '#', '%', '.', ',', '&', '(', ')', '-', '@', '_', '`', '{', '}', '~', "'"} contains ch) {
							fllegal = false}}}};
			if fllegal {
				s = s + ch}};
		return (s)}
	else {
		fname = string.replaceall (fname, ":", "-");
		fname = string.replaceall (fname, "!", "");
		fname = string.replaceall (fname, "|", "");
		return (fname)}}



This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.