c# - Directory.CreateDirectory strange behaviour -
i have windows service runs separate thread function may do
if (!directory.exists(tempupdatedir)) { directoryinfo di = directory.createdirectory(tempupdatedir); di.refresh(); eventlog.writeentry("downloader", string.format("debug: trying create temp dir:{0}. exists?{1},{2}",tempupdatedir, directory.exists(tempupdatedir), di.exists)); }
which not throw exceptions, directory.exists says true (inside if block) , yet there no such directory on disk, when explorer. i've seen directory created couple of times, of time directory isn't created, no exceptions thrown either.
(this service runs under local system) later on service starts program using process class , exits. program suppose work files, copy them created directory, doesn't either.
code has problems on windows 2003 server.
what the....?????????????
my guess tempupdatedir
relative directory name, , doesn't refer think does. it's hard without more information though. useful log absolute path well, make easier check.
Comments
Post a Comment