<i>win32 error during simultaneous file open for read</i> status still Open with 4 other changes
by
.
D 2007-12-15T05:29:30
J icomment Logged\sIn:\sYES\s\nuser_id=585068\nOriginator:\sNO\n\nAfter\sreading\sMSDN\sI'm\snot\ssure\sthis\sis\sa\sbug\sthat\sis\sfixable\sin\sTcl,\swithout\sa\shack\sthat\sreally\swouldn't\sbe\sappropriate.\n\nTo\squote\sfrom\sMSDN:\s"When\sa\sprocess\sattempts\sto\sopen\sa\sfile\sthat\shas\salready\sbeen\sopened\sin\ssharing\smode,\sthe\ssystem\scompares\sthe\srequested\saccess\sand\ssharing\smodes\sto\sthose\sspecified\swhen\sthe\sfile\swas\sopened.\sIf\syou\sspecify\san\saccess\smode\sthat\sconflicts\swith\sthe\ssharing\smode\sspecified\sin\sthe\sprevious\sopen\scall,\sCreateFile\sfails\swith\sa\ssharing\sviolation\s(ERROR_SHARING_VIOLATION)."\n\nI\sthink\sthis\smeans\syou\sjust\scan't\sdo\ssome\sthings\sin\sWindows\sthat\syou\swant\sto\sdo,\sunless\syou\sremove\sthe\sFILE_SHARE_*\sflags\sfrom\sthe\sCreateFile\scall.\n\nHowever,\sI\sjust\snoticed\sthat\sNativeStat()\sin\sthe\swin\stree\suses\s"FILE_SHARE_READ\s|\sFILE_SHARE_WRITE"\s(used\sto\sdetect\spermissions\sit\sseems)\swith\sCreateFile.\s\sThere\scould\sbe\sa\srace\sbetween\sthe\sstat\sin\sone\sthread,\sand\san\sopen\sin\sanother.\s\sSo\seven\sthough\syou\sonly\swant\sone\shandle\sopen,\sthe\sstat\sis\scausing\sthe\sopen\sto\sfail\sin\ssome\scases.\s\sThis\sisn't\sgood...\n\n
J login georgeps
J mimetype text/plain
J username georgeps
K 1593707fffffffffffffffffffffffffffffffff
U georgeps
Z b151262f4e33c6fdd4476af168abf922