Git Product home page Git Product logo

Comments (6)

JamesHeinrich avatar JamesHeinrich commented on August 23, 2024

Is this bug documented somewhere? Is it specific to PHP 5.5(.30)?

A quick test on PHP 5.3.3 (*nix) and PHP 5.4.7 (Win) showed no problems:
echo (is_readable($filename = tempnam('/tmp','getid3')) ? '' : 'not-').'readable: '.$filename;
What does that line of code output for you?

from getid3.

gottsohn avatar gottsohn commented on August 23, 2024

It outputs false for me.
For is_readable and is_writeable, is_file works fine.
I came across the error on Google App Engine, where I host my application.

I have only tried this out on PHP 5.5.X.
I'll find time later on to break down the issue, but this is the result I've gotten so far.

from getid3.

JamesHeinrich avatar JamesHeinrich commented on August 23, 2024

"false" is an unexpected output from that line -- it should say either readable or not-readable and confirmation of the temp filename that's generated. Perhaps this code is more explicit:

$filename = tempnam('/tmp', 'foo');
echo 'filename: '.$filename.'<br>';
echo (is_readable($filename) ? 'readable' : 'not-readable').'<br>';
echo (is_writeable($filename) ? 'writeable' : 'not-writeable').'<br>';
unlink($filename);

When you have time later to do some debugging it would be appreciated. After a few minutes of searching I can't find any other reports of the problem you describe with tempnam.

At this point my speculation is that tempnam() is returning false for you. getID3 attempts to auto-detect the appropriate system temp directory in which to create temp files, but if that's failing for you there is an override line you can uncomment in getid3.php line 63 where you can enter a temp directory you do have read/write access to.

from getid3.

gottsohn avatar gottsohn commented on August 23, 2024

Sorry about that, my response was the bool value of is_writeable. I didn't explicitly run your code block.

Anyways, I ran a full test, the temp file can we written, read and copied to a different location (on the local file system), and so on, but will always return false from the two highlighted functions.

Here's the result from your code block as well.

filename: vfs://root/temp//tmp/foo56cb16f2992517.13579214
not-readable
not-writeable

It's a PHP issue, not the getID3 library.
I edited a piece of the library to get it to run properly on my app.
I could submit a PR later on with What-Why-How in detail so you'll get the full gist.

from getid3.

JamesHeinrich avatar JamesHeinrich commented on August 23, 2024

I think filename: vfs://... is the key issue here.

Your analysis and code suggestions are welcome.

from getid3.

JamesHeinrich avatar JamesHeinrich commented on August 23, 2024

Closing issue for now. If you have future analysis or suggestions you wish to post, please do so.

from getid3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.