On Wed, Feb 17, 2010 at 12:21 PM, Matthew Toseland <[email protected]> wrote: > + private static final boolean operatingSystemIsWindows() { // TODO: > Move to the proper class > + try { > + return > System.getProperty("os.name").toLowerCase().indexOf("win") >= 0; > + } catch(Throwable t) { > + return true; // :) > + } > + } > > IMHO this is dodgy, other OSs might have "win" in them. Normally we just > check if File.separator is "\". > > I am not convinced that the rest of the change is a good idea. For example > allowing HTML markup in filenames might combine with sloppy code to cause > problems. Allowing % in url's might again cause issues. Allowing pipes, <>, > and spaces might cause problems with filenames copied to a shell. I guess it > should depend on the configuration i.e. how paranoid the user is.
Similarly, as I've mentioned on IRC, I think we should take a set of characters that will work on all common OSes (modern Windows, Linux, OSX, BSDs) and filter to that regardless of host OS, and that we should filter both on upload and download. This would make it vastly simpler to have one person upload a file, and then have a second download it and re-upload it and produce the same key. Inserts of the same file that produce different keys is going to be a continuing problem in making file sharing work well. Obviously as long as we include the filename in the metadata it's not completely solvable, but we can at least try to avoid making the problem any worse. To really make filesharing viable I think we eventually need a distributed way to do SHA / MD5 / magnet link -> CHK lookups, but that's a long-term thing and not trivial. For now, I think having Freenet not change the filename under normal usage patterns is a good start. Evan Daniel _______________________________________________ Devl mailing list [email protected] http://osprey.vm.bytemark.co.uk/cgi-bin/mailman/listinfo/devl
