<i>difference in behavior of "file exists <name>" when <name> r</i>.
by
.
D 2000-10-26T01:01:41
J assignee nobody
J cmimetype text/plain
J comment OriginalBugID:\s889\sBug\nVersion:\s8.0.3\nSubmitDate:\s'1998-12-02'\nLastModified:\s'1999-08-20'\nSeverity:\sMED\nStatus:\sReleased\nSubmitter:\sadmin\nChangedBy:\shobbs\nOS:\sAll\sWindows\nOSVersion:\sNA\nMachine:\sNA\nFixedDate:\s'1999-08-20'\nFixedInVersion:\s8.2\nClosedDate:\s'2000-10-25'\n\n\nI\shave\snoticed\sthat\sthere\sis\sa\sdifference\sin\sthe\sprocessing\sof\sthe\n"file\sexists\s<name>"\scommand\sin\sthe\s8.0.3\sversion\swhen\s<name>\srefers\nto\sremovable\smedia.\s\sOn\sthe\s8.0p2\sversion,\sthe\scommand\swould\sjust\nreturn\sa\sresult.\s\sBut\sthe\s8.0.3\sversion\sdisplays\sa\sdialog\scontaining\n"There\sis\sno\sdisk\sin\sthe\sdrive.\s\sPlease\sinsert\sa\sdisk\sinto\sdrive\n<name>."\s\sThis\snew\saction\sis\sundesirable\sand\sunwanted.\s\sThe\napplication\scode\sshould\sbe\sgiven\sthe\sopportunity\sto\sreact\sto\sthe\nsuccess\sor\sfailure\sof\sthe\scommand.\n\s\n\sTested\son:\n\s\s\sWindows\sNT\s4.0\sSR3\n\s\s\sWindows\s95\n\s\nFrom\sthe\s8.0p2\sconsole\sand\swith\sno\sdiskette\sin\sdrive\sA:\n\s%\sfile\sexists\sa:\n\s%\s0\n\s\nFrom\sthe\s8.0.3\sconsole\sand\swith\sno\sdiskette\sin\sdrive\sA:\n\s%\sfile\sexists\sa:\n\s-\s-->\sdialog\sis\sdisplayed.\s\spressed\s"Abort"\sbutton\n\s%\s0\n\n\nThis\ssounds\slike\sa\sdifference\sbetween\sthe\sVC++\sand\sBorland\srun-time\slibraries.\s\n\sI\sthink\sit\scan\sbe\sfixed\sby\sregistering\san\sappropriate\sexception\shandler.\s\s\nThis\sshould\sbe\slogged\sas\sa\sbug.\s\s--Scott\n-----\ncomments\sfrom\ssyd\spolk:\n\nOK,\sI\sthink\sI\shave\stwo\sfixes.\n\nFirst\sof\sall,\sin\stclIO.c,\sin\sTranslateOutputEOL,\sthere\sis\sa\scase\sfor\nTCL_TRANSLATE_CRLF.\sThe\sfor\sloop\sis\snot\schecking\sfor\srunning\soff\sof\sthe\send\nof\sthe\sdst\sbuffer.\sWhat\shappens\sis\sthat\sthe\slast\scharacter\sthe\sprevious\ninteration\sis\sa\sCR.\sIt\sstuffs\sboth\sCR\sand\sLF\sinto\sthe\sbuffer,\sand\sreturns\none\smore\sthan\sthe\smax\ssize.\sThe\scalling\sroutine,\sWriteChars,\snotes\sthe\nextra\scharacter\sand\ssaves\sof\sthe\ssplit.\sIt\sthen\sdecrements\sthe\sbuffer\ssize\nwhich\sit\spasses\sback\sin\sbecause\sthe\sbuffer\salready\shas\san\sLF\sin\sit.\sThe\nTCL_TRANSLATE_CRLF\scase\sthen\signores\sthat\sfact\sand\sit\ssets\sup\san\sendless\nprocession\sof\sextra\scarriage\sreturns.\n\nThe\sloop\sneeds\sto\sbe\sset\sup\sto\sstop\swhen\srunning\sout\sof\ssource\sor\swhen\nrunning\sout\sof\sdst.\n\n\nThe\sother\sproblem\sis\smuch\smore\ssubtle\sand\snot\snearly\sso\simportant.\n\nIn\sWriteChars,\sthe\sTranslateOutputEOL\sroutine\sreturns\swhether\sor\snot\sit\ssaw\na\scarriage\sreturn.\sThis\sinformation\sis\spassed\sto\sCheckFlush.\sOn\sa\nline-buffered\schannel,\sCheckFlush\suses\sthis\sinformation\sto\sdetermine\nwhether\sor\snot\sto\sactually\sflush\sthe\schannel.\n\nThe\sproblem\sis\sthat\sthe\sflag\sis\snever\sreset.\sSo\sif\sthere\sare\slines\slonger\nthan\sthe\sbuffer\ssize\safter\sthe\sfirst\sline\sfeed\sis\sseen,\severy\swrite\swill\nflush.\n\nAlso,\sin\sthe\scase\sof\sTCL_TRANSLATE_CR\sor\sTCL_TRANSLATE_LF,\sthe\scode\sdoes\sa\nmemcpy,\sand\sthen\straverses\sthe\sbuffer\sagain\sto\sfind\sreturns.\sShouldn't\sit\ncopy\scharacter\sby\scharacter\sand\snote\sreturns\son\sthe\sway,\sthus\ssaving\sa\ncomplete\straversal\sof\sthe\scode?\sRight\snow,\sit\slooks\slike\sit\sis\sfaster\sto\nwrite\sout\scharacters\swith\scrlf\sthan\sthe\sother\stwo.\n\nI\swill\shave\sa\spatch\sfor\sthese\sproblems\sby\stomorrow\smorning.\n--\nThe\sabove\scomments\sdon't\sseem\sto\srelate\sto\sthis\sbug\sid,\sbut\sthis\nproblem\shas\sbeen\sfixed\sin\snewer\sreleases,\salso\swith\sthe\saddition\nof\sa\sfile\svolumes\scommand.\s\n--\s08/20/1999\shobbs
J foundin obsolete:\s8.0.3
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 37.\sFile\sSystem
J title difference\sin\sbehavior\sof\s"file\sexists\s<name>"\swhen\s<name>\sr
J type Bug
K 218525ffffffffffffffffffffffffffffffffff
U nobody
Z 6c9ced4fa0eee0ee8b82c6fd987d7261