Giter Club home page Giter Club logo

Comments (13)

devnexen avatar devnexen commented on September 1, 2024

I cannot reproduce with php 8.3.6 nor with 8.3.8, would you have a reproducer or give more details regarding your case ?

from doc-en.

RV7PR avatar RV7PR commented on September 1, 2024

I also have this issue on another server with centos 7 and php 8.3.8.
It's just a symlink created using symlink() that I want to delete after I get the size.

from doc-en.

devnexen avatar devnexen commented on September 1, 2024

There might be more to it. e.g. are you getting a symlink from a shared (virtualised ?) folder ? network mountpoint ?

from doc-en.

RV7PR avatar RV7PR commented on September 1, 2024

Nope it's a symlink to a file in the same folder.
But it might be that the target file is deleted before the symlink itself.

from doc-en.

devnexen avatar devnexen commented on September 1, 2024

It might thus

would you have a reproducer or give more details regarding your case ?

from doc-en.

RV7PR avatar RV7PR commented on September 1, 2024
$file = tempnam(sys_get_temp_dir(), '');
$symlink = $file . '.symlink';
symlink('./' . basename($file), $symlink);
unlink($file);
var_dump(filesize($symlink));

from doc-en.

devnexen avatar devnexen commented on September 1, 2024

sure ... looking at php_stat, it seems to behave "as expected', now I m torn between bug and "feature request to change longtime behavior".

from doc-en.

RV7PR avatar RV7PR commented on September 1, 2024

Yeah I didn't expect it to behave like this, I thought filesize would show size of the file supplied and not the target file of a symlink, would've made more sense to do filesize(realpath()) if target file size was needed🤔

Well probably because in most cases filesize of a symlink would be irrelevant😅

from doc-en.

bukka avatar bukka commented on September 1, 2024

I don't think we can change this. I would not consider it as a bug. This would require RFC to get changed.

from doc-en.

cmb69 avatar cmb69 commented on September 1, 2024

@RV7PR, are you interested in pursuing the RFC process?

from doc-en.

RV7PR avatar RV7PR commented on September 1, 2024

@cmb69 Not really... maybe we should just add a note for filesize() and SplFileInfo::getSize() specifiying that it always uses the target file of a symlink and if the filesize is needed for a symlink that lstat()['size'] should be used and that if target file does not exists anymore it generates a warning.

from doc-en.

cmb69 avatar cmb69 commented on September 1, 2024

Well, I'm fine with transferring this to doc-en (so the documentation could be updated). Any objections?

from doc-en.

RV7PR avatar RV7PR commented on September 1, 2024

I'm okay with that

from doc-en.

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.