Re: Delete a file

new topic     » goto parent     » topic index » view thread      » older message » newer message

> }}}
<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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu