.
D 2014-04-11T08:20:54.006
J closer nobody
J comment Some\sfile\scommands\streat\sNUL\s(\\0)\sas\sa\sstring\sterminator.\s\sOthers\streat\sit\sas\sa\snormal\scharacter.\s\sThis\sinconsistency\smakes\sit\spossible\sto\sspoof\scommands\sthat\sfilter\sbased\son\sfilename,\sparticularly\sextension.\s\sExample:\r\n\r\nproc\saccess\s{name}\s{\r\n\s\s\s\sif\s{[file\sextension\s$name]\seq\s".secret"}\s{\r\n\s\s\s\s\s\s\s\serror\sdenied\r\n\s\s\s\s}\selse\s{\r\n\s\s\s\s\s\s\s\sputs\sgranted\r\n\s\s\s\s\s\s\s\sopen\s$name\r\n\s\s\s\s}\r\n}\r\n%\saccess\sfile.secret\r\ndenied\r\n%\saccess\sfile.secret\\0\r\ngranted\r\nfile5\r\n\r\nGenerally,\sit's\sthe\scommands\sthat\stalk\sto\sthe\soperating\ssystem\sthat\streat\sNUL\sas\sthe\sstring\sterminator.\s\s(More\slikely\sit's\sthe\soperating\ssystem\sitself\sthat\sdoes\sthis!)\s\sFor\sexample,\s[open]\sand\s[cd]\sdo\sthis:\r\n\r\n%\scd\s.\r\n%\scd\s.\\0\r\n%\scd\s\\0.\r\ncouldn't\schange\sworking\sdirectory\sto\s"NUL.":\sno\ssuch\sfile\sor\sdirectory\r\n#\s(in\sthe\sprevious\sline,\sNUL\sis\sa\sreal\sNUL\scharacter;\sto\ssee\sit,\suse\stkcon\sinstead\sof\sxterm)\r\n%\sfile\sexists\s.\r\n1\r\n%\sfile\sexists\s.\\0\r\n1\r\n%\sfile\sexists\s\\0.\r\n0
J icomment Fixed\sin\strunk\sfor\sWindows\sonly\s[0f4597a73cae916f979f4bd22eeb9f8dc5cd467f|0f4597a73c]\sby\stranslating\ssome\scharacters\swhich\sare\sinvalid\sfor\swin32\sfilenames\sto\sother\scharacters\sas\sdescribed\shere:\s[http://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-specialchars].\s(The\scharacters\s':'\sand\s'?'\sare\snot\shandled,\sbecause\s':'\sis\svalid\sas\sdrive\sspecifier\sand\s'?'\sis\svalid\sin\sthe\sextended\spath\sprefix.)\r\n\r\nCode\sinspired\sby\sfossil:\s[http://www.fossil-scm.org/index.html/artifact/76559aefff?ln=245-252]
J login jan.nijtmans
J mimetype text/x-fossil-wiki
J severity Minor
K 3118489fffffffffffffffffffffffffffffffff
U jan.nijtmans
Z c1fc7979aab9bcfdf6770fec31226f95