Skip to content
Tcl Source Code Artifact [fbb0e79a57]
Login

Artifact [fbb0e79a57]

Artifact fbb0e79a570d0f2b18de56bc5e4927bfc1f67582:

Ticket change [fbb0e79a57] - Ticket [b42a8514758d43c0|b42a851475] <i>file normalize ~user returns wrong directory on Windows</i> status still Open with 3 other changes by apnadkarni on 2015-10-06 10:14:56.
D 2015-10-06T10:14:56.697
J icomment Some\smore\sinformation\slooking\sat\sthe\scode\sin\sTclpGetUserHome\sin\stclWinFile.c\r\n\r\n-\sfile\snormalize\s~\slooks\sat\sthe\sHOME\senvironment\svariable\swhereas\s~ashok\slooks\sat\sthe\sNetUserGetInfo\scall.\sThe\slatter\sonly\sreturns\snon-null\sdirectory\sinformation\sif\sadministrator\shas\sexplicitly\sset\sthe\shome\sdir\spath.\sUnder\sthe\snormal\s(default)\scase\san\sempty\sstring\sis\sreturned.\s\r\n\r\n-\sWhen\sthe\shome\sdir\sis\s"",\sthe\scode\sthen\scalls\sback\sto\s%SYSTEMDRIVE%:/users/default.\sThis\sis\sbroken\sfor\smany\sreasons\s-\sthe\stoplevel\sis\s"users"\sonly\son\snewer\sWindows\sversions\sand\seven\sthat\scan\sbe\schanged.\sSecondly\sthe\sreturned\sdirectory\sis\snot\swritable\sby\sthe\suser\swithout\selevation.\sThird,\sit\sdoes\snot\scontain\sany\sfiles\sspecific\sto\sthe\suser.\r\n\r\nThe\scorrect\ssolution\swould\sbe\sto\suse\sGetUserProfileDirectory\sbut\sthat\sis\sunworkable\sbecause\sthat\scall\srequires\sa\ssecurity\stoken\swith\sthe\sappropriate\saccess\srights.\r\n\r\nA\ssemi-workable\ssolution\swould\sbe\sto\suse\sGetProfilesDirectory\sand\stack\son\sthe\suser\sname\s(essentially\s~ashok\s->\sGetProfilesDirectory/ashok)\sand\sreturn\sit\sif\sthe\scorresponding\sdirectory\sexists.\sHowever,\sin\sthis\scase\s~\sand\s~ashok\swill\snot\smatch.\sWe\scannot\schange\ssemantics\sof\s~\sbecause\scurrent\sprograms\smight\sbe\srelying\son\sit.\sAdding\son\sa\sDocuments\spart\sto\sthe\sresult\sof\s~ashok\sis\sproblematic\sbecause\s(I\sthink)\sthe\sfolder\sis\snot\scalled\sDocuments\son\sall\sWindows\sversions.\r\n\r\nMy\ssuggestion\sis\sto\sgo\swith\sthe\ssemi-workable\ssolution\sbecause\sit\sis\sbetter\sthan\swhat\swe\sdo\stoday.
J login apnadkarni
J mimetype text/plain
K b42a8514758d43c03f5404feb5543f921c22cf09
U apnadkarni
Z 50cd549ab911555a135fe49b34e2fd53