Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Deleting file using \File::delete
  • Hi, I want to delete a file using the \File::delete() function, but there's no documentation about it and I keep getting a
    Fuel\Core\Fuel_Exception [ Error ]: Cannot delete file: given path "/modules/puas/config/install.php" is not a file.
    
    exception. I want to be able to delete a config file inside a module, as I keep record of some "module installation" params. When I "uninstall" a module I want to get rid of that config file.
  • Never mind! I found out... one must first look-out the path using
    \Fuel::find_file()
    
    then one must call
    \File::delete()
    
    with the returned path:
    $path = Fuel::find_file('config', 'Module::file');
    if(!empty($path)){
     \File::delete($path);
    }
    

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion