]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/Filenames_with_colons_cause_problems_for_Windows_users.mdwn
Merge branch 'master' into po
[ikiwiki.git] / doc / bugs / Filenames_with_colons_cause_problems_for_Windows_users.mdwn
1 (Note: feel free to say "not a bug" or offer a workaround rather than changing ikiwiki.)
2
3 As reported by a Windows user trying ikiwiki: because Windows doesn't support filenames with colons, he couldn't check out the ikiwiki svn repository.  More generally, ikiwiki doesn't encode colons in filenames for wiki pages, but to support Windows users perhaps it should.
4
5 Windows does not support filenames containing any of these characters: `/ \ * : ? " < > |`
6
7 > I take it this is a problem when checking out a wiki in windows, not when
8 > browsing to urls that have colons in them from windows? --[[Joey]]
9
10 >> Correct.  You can't directly check out a wiki's repository from Windows if it includes filenames with those characters; you will get errors on those filenames.
11
12 >>> Ok, first, if a windows user fails to check out ikiwiki's own svn^Wgit
13 >>> repo on windows due to the colons, that seems to be a bug in svn^Wgit
14 >>> on windows -- those programs should deal with colons in filenames being
15 >>> checked in/out somehow. Like they deal with windows using backslash
16 >>> rather than slash, presumably. And there's nothing ikiwiki can do if
17 >>> the source repo it's working on has a file with a problem character
18 >>> added to it, since the breakage will happen at the revision control
19 >>> system level.
20
21 >>>> Just a quick note that the version control community generally doesn't
22 >>>> agree with that view.  They'll store what you ask them to store.  If you
23 >>>> want to work cross platform, then you need to make sure that all
24 >>>> your file names work on all the platforms you're interested in.  (Note: many systems will
25 >>>> warn on commit, but not all.  Many systems also have a way to fix
26 >>>> the problem without checking out, but not all.)  Another common place for this to
27 >>>> arise is case insensitive file systems.  If you have two files committed
28 >>>> that differ only in case, then you cannot check out on a Mac in most systems.
29
30 >>> OTOH, there are some simple mods to ikiwiki that can make it escape
31 >>> colons etc the same way it already escapes other problem characters
32 >>> like "*", "?", etc. Without actually testing it, it should suffice to
33 >>> edit `IkiWiki.pm` and modify `titlepage` and `linkpage`, removing the
34 >>> colon from the character class in each. Also modify the
35 >>> `wiki_file_regexp` similarly. Then ikiwiki will read and
36 >>> write files with escaped colons, avoiding the problem.
37 >>>
38 >>> So that's a simple fix, but on the gripping hand, I can't just make
39 >>> that change, because it would break all existing unix-based
40 >>> wikis that actually contain colons in their filenames, requiring an
41 >>> annoying transition. I could do a OS test and do it in Windows, but then
42 >>> there would be interop problems if a Windows and non-windows system both
43 >>> acted on the same wiki source.
44
45 >>>> I haven't checked the source, but need this break existing wikis?
46 >>>> I can imagine a system where a colon gets converted to something safe,
47 >>>> and the safe encoding gets converted back to a colon.  But if you
48 >>>> already have a colon, that doesn't get converted and stays a colon, and
49 >>>> so it should still work shouldn't it?  The only
50 >>>> problem would be with pages that already have the 'safe encoding for a colon'.
51 >>>> They'll suddenly change names. Well, I should finish frying my current fish
52 >>>> before taking on something new, so I'll shut up now :). -- [[Will]]
53
54 >>>>> If `linkpage()` is changed to escape colons, then links to pages 
55 >>>>> with literal colons in their names will stop working; ikiwiki will
56 >>>>> instead look for page names with escaped colons. --[[Joey]]
57
58 >>> So, I guess it has to be a config option, possibly defaulting on
59 >>> when the OS is Windows. And if being able to checkout/etc the wiki
60 >>> source on windows systems is desired, you'd have to remember to turn
61 >>> that on when setting up a wiki, even if the wiki was hosted on unix.
62 >>>
63 >>> Ok, `wiki_file_chars` config option added, set to 
64 >>> `"-[:alnum:]+/._"` to exclude colons from filenames read or written by
65 >>> ikiwiki. [[done]]
66 >>> 
67 >>> BTW, I suspect there are lots of other problems with actually running
68 >>> ikiwiki on windows, including its assumption that the directory
69 >>> separator is "/". Windows will be supported when someone sends me a
70 >>> comprehansive and not ugly or performance impacting patch. :-) --[[Joey]]