Hi, I have a file: d:\foo.txt and want to delete this. I tried: system("del d:/foo.txt") works not system("notepad d:/foo.txt") works Is it possible that I can't delete files or do I have misunderstood something? (del is a DOS-command. The "string works" under DOS "\") Thanks a lot Thomas ----- Windows XP R 1.6.2 (update!, I know)
Untern?hrer Thomas, uth wrote:> Hi, > > I have a file: d:\foo.txt and want to delete this. > > I tried: > system("del d:/foo.txt") works not > system("notepad d:/foo.txt") works > > Is it possible that I can't delete files or do I have misunderstood something? > > (del is a DOS-command. The "string works" under DOS "\") > > > Thanks a lot > > Thomas >Two simple ways: file.remove("d:/foo.txt") and shell("del d:\\foo.txt") Uwe Ligges
On Tue, 13 May 2003, "Untern?hrer Thomas, uth" wrote:> I have a file: d:\foo.txt and want to delete this. > > I tried: > system("del d:/foo.txt") works not > system("notepad d:/foo.txt") works > > Is it possible that I can't delete files or do I have misunderstood something? > > (del is a DOS-command. The "string works" under DOS "\")And your OS appears to be *Windows* not DOS! You could try ?shell to see how to run a shell and its commands. However, ?unlink would be more profitable. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
On Tue, 13 May 2003, [iso-8859-1] "Unternährer Thomas, uth" wrote:> I have a file: d:\foo.txt and want to delete this. > I tried: > system("del d:/foo.txt") works not > system("notepad d:/foo.txt") works > Is it possible that I can't delete files or do I have misunderstood something?unlink()