I get these errors:

Warning: fopen(tmp/::name.hsh) [function.fopen]: failed to open stream: Invalid argument in ...

Warning: fwrite() expects parameter 1 to be resource, boolean given in...

Warning: fclose() expects parameter 1 to be resource, boolean given in ...

Can anyone advise me what is the problem? Tough is a permission problem but permissions look fine

The code that generates the error is:

    if (!file_exists($File)) {
    $Handle = fopen($FileHash, 'w');
    fwrite ($Handle, $audio_hash.$LINE_BRK);
    fwrite ($Handle, $playlist.$LINE_BRK);
    fclose ($Handle);
    $Handle = fopen($File, 'w');

Recommended Answers

All 4 Replies

It seems $FileHash variable is false or not valid. Echo that and check if the path is correct.

Echoing gives no result...$FileHash is about the temp location...the path is ok but still fails to work in temp folder

Ok but can you paste an example of this path? Because maybe your calling tmp/name.hsh which is relative to the running script, instead of /tmp/name.hsh that point to the root of the OS.

is a player and doesnt work on localhost(xamp) or on real host...and the temp folder is tmp inside the htdocs or on real server ...tmp is at root/public files...the list of errors is little longer continues with next:
fopen(tmpa/::187jbg.xspf) [function.fopen]: failed to open stream: Invalid argument in ...xampp\htdocs...file.php
and after that follow same fwrite errors(now are 9 fwrite error warnings as above) and one fclose error and that s all
...i think these hsh file should be writen at tmp folder but gets error becouse of something and cant write it

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.