Welcome Guest, Not a member yet? Register   Sign In
File helper

Hi all...
I'm working with files... the write_file works fine.. but.. how can I delete a file?
I try with the
$file_delete = '/var/www/xmlrpc/listas/'.$nombre_lista.".txt";

but does not work... so.. I try with the unlink

$file_delete = '/var/www/xmlrpc/listas/'.$nombre_lista.".txt";

and does not work either.. the file was created by the write_file method of the file helper...

any ideas?

Bye Smile

Hi latuss,

I think the problem is that unlink(...) does not like directories/paths.

I have vague memories of the same problem and my 'Kludge' was to:

1. save the directory where you are - getcwd()
2. change to the directory where the file exists - chdir()
3. unlink('the_file')
4. change back to the original directory.


I'm pretty sure unlink works ok using full paths.
Check if file_exists and is_writeable to check...

Theme © iAndrew 2016 - Forum software by © MyBB