delete files from c++ code
-
i was trying system(del(filename)); but its giving error any ideas??? thanks
-
i was trying system(del(filename)); but its giving error any ideas??? thanks
That's really going the long away around to delete a file. How about the
DeleteFile
function? -
i was trying system(del(filename)); but its giving error any ideas??? thanks
-
i was trying system(del(filename)); but its giving error any ideas??? thanks
Del is not a program. It's a shell builtin, just like dir is. Thus, system doesn't know what Del is. There is no del.exe. Use DeleteFile if you're using Win32 code, or remove if using standard C code. -- Where are we going? And why am I in this handbasket?
-
Del is not a program. It's a shell builtin, just like dir is. Thus, system doesn't know what Del is. There is no del.exe. Use DeleteFile if you're using Win32 code, or remove if using standard C code. -- Where are we going? And why am I in this handbasket?
Erik Funkenbusch wrote: Del is not a program. It's a shell builtin, just like dir is. Thus, system doesn't know what Del is. There is no del.exe. del.exe doesn't exist, but
system()
doesn't launch programs. it executes shell's commands, just asdel
,dir
,cls
... if you trysystem("cls");
, your screen (in console mode, of course) will be cleared... the problem in monageasmear's code is that he doesn't enclose thesystem()
's parameter into""
... cheers,
TOXCCT >>> GEII power
[toxcct][VisualCalc] -
i was trying system(del(filename)); but its giving error any ideas??? thanks
i think if you had written
system("del filename");
if would have worked. first, you must know the
del
shell's command syntax ; secondly, if you had a look at the MSDN, you would see thatsystem()
gets aLPCTSTR
, it means aconst TCHAR*
, that's why i use a string parameter... and to finish, system() is not recommended, as Graham Bradshaw , [DFS] Zero and Erik Funkenbusch said...
TOXCCT >>> GEII power
[toxcct][VisualCalc]