Re: Delete a file
- Posted by Greg Haberek <ghaberek at gmail.com> Jun 26, 2005
- 611 views
> }}} <eucode> > procedure delete_file( sequence filename ) > </eucode> {{{ I realized one may pass file names with spaces to this routine. I added quotes to the commands.
procedure delete_file( sequence filename ) sequence cmd if platform() = 3 then -- Linux cmd = "rm \"%s\" -f" else -- DOS or Windows cmd = "del \"%s\" /f /q" end if cmd = sprintf( cmd, {filename} ) system( cmd, 2 ) end procedure
~Greg