<i>recursive file/dir delete broken on OSX</i> status still Open with 4 other changes
by
.
D 2005-10-04T01:23:32
J icomment Logged\sIn:\sYES\s\nuser_id=72656\n\nThis\sis\sfrom\sa\sdiscussion\swith\sDAS\son\sthe\sproblem\s(me\s>\nquoted,\sDAS\sbare):\n\n>\sSo\sI'm\scurious\swhether\sthis\sshould\sbe\sconsidered\s"correct"\nacross\s\n>\splatforms\sor\snot.\s\sIt\scertainly\sseems\sundesirable\sthat\sa\nfile\sdelete\s\n>\s-force\scan\seffectively\shang\sdue\sto\sNFS\sfile\srecreation.\n\nI\sbasically\sjust\simplemented\sin\sTraverseUnixTree()\sthe\nchange\sdescribed\s\s\nby\sthe\sapple\snote,\si.e.\sthe\sneed\sto\sdo\sa\srewind\safter\sany\nreaddir\sloop\s\s\ninvolving\sdeletion\sof\sfiles\sin\sthe\sdirectory\sbeing\siterated.\nAs\sthe\s\s\nnote\sexplains,\sit\sis\sunspecified\sif\sreaddir()\siterates\sover\nall\sfiles\s\s\nin\sthat\scase,\sand\sfor\sHFS\sfile\ssystems\sthis\sis\sindeed\snot\nalways\sthe\s\s\ncase\s(c.f.\stest\sfCmd-20.2).\sNote\sthat\sthis\sissue\smay\soccur\non\ssystems\s\s\nother\sthan\sDarwin\sif\sthey\shave\san\sHFS\sfilesystem\smounted\svia\nNFS\sas\s\s\nmentioned\sin\sthe\snote.\n\n>\sIn\sNFS\sworld,\sif\sa\sfile\sopen\sand\sif\sgets\sdeleted\sby\ssome\nother\s\n>\sprocess,\sthe\sfile\swill\sbe\srenamed\sas\s.nfsXXX(and\swill\s\nhave\ssame\scontents\sof\n>\sthis\n>\sdeleted\sfile).\s\sAny\sdir\swhich\shas\sthese\stype\sof\shidden\nfiles\scannot\sbe\n>\sdeleted.\n\nclearly\sthis\sbehaviour\swill\scause\san\sinfinite\sloop\sproblem\nwith\sthe\s\s\nrewind\scode\sas\simplemented\sas\sany\snon-empty\sdir\scannot\sever\nbe\semptied\s\s\neven\swith\sall\sthe\scalls\sto\sTclpDeleteFile()\sduring\sthe\nreaddir\slopp\s\s\nreturning\sno\serrors...\s(of\scourse,\sIMHO\sreturning\sno\serror\nwhen\s\s\ndeleting\ssuch\sa\sspecial\s.nfsXXX\sfile\sshould\sprobably\snot\sbe\nconsidered\s\s\ncorrect\sbehaviour...)\n\nThe\ssimplest\ssolution\swould\sbe\sto\sspecial\scase\sthose\s.nfsXXX\nnames\s\sat\s\s\nthe\stop\sof\sTraverseUnixTree(),\swhere\swe\salready\scheck\sfor\s.\nand\s..\s\s\nnames.\sOf\scourse\sif\ssimilar\sissues\sexist\swith\sother\nfilesystems\sthat\s\s\nuse\sother\smagic\snames,\sthis\sis\snot\sa\sgood\sgeneral\ssolution...\n\nOtherwise,\sit\swould\sbe\spossible\sto\sreimplement\srecursive\ndeletion\sby\s\s\nfirst\senumerating\sall\sdirectory\sentries\sand\sonly\sthen\ndeleting\sthem\s\s\nall,\sthis\swould\savoid\sthe\sunspecified\sreaddir\sbehaviour(),\nbut\scould\s\s\npresent\smemory\sissues\sfor\slarge\sdirectory\strees\n\nDarwin\sand\sother\sBSDs\salso\shave\sthe\smore\sefficient\sfts_\nfamily\sof\s\s\nfunctions\sfor\sdirectory\straversal\s(c.f.\sman\s3\sfts\son\sOSX)\nwhich\sdo\snot\s\s\nhave\sthis\sissue\sAFAICT,\sso\sTraverseUnixTree()\scould\sbe\nreimplemented\s\s\nusing\sthis\ssuch\splatforms,\sbut\sthat\swill\snot\ssolve\sthe\sissue\ngenerally\s\s\neither...\n\n
J login hobbs
J mimetype text/plain
J username hobbs
K 1034337fffffffffffffffffffffffffffffffff
U hobbs
Z 0a0adbc54c7d049f0590e67a5499c351