Hi all,
for the TeX Live uninstaller I am trying to write a rmdir function for
win32 in texlua which should work like rm -rf on unix.
My first try was:
function rmdir(dirn)
if os.type == 'windows' then
-- we have to replace all / with \
foo = string.gsub(dirn, '/', '\\')
ret = os.spawn({"rmdir", "/s", "/q", foo})
else
ret = os.spawn({"rm", "-rf", dirn})
end
if ret then
return ret
else
io.stderr:write(filename..': removing '..dirn.." didn't work\n")
end
return ret
end
(No checks by now, will come later ...)
But that didn't work and did spit out always the io.stderr message.
Any suggestion how to do that? Or is there some code already somewhere
around in the ConTeXt project?
Thanks and all the best
Norbert
-------------------------------------------------------------------------------
Dr. Norbert Preining