thephpleague / flysystem

Abstraction for local and remote filesystems
https://flysystem.thephpleague.com
MIT License
13.37k stars 831 forks source link

Fatal Error SplFileInfo::getType(): Lstat failed if Directory or file is not readable. #472

Closed sukrit-adhikari closed 8 years ago

sukrit-adhikari commented 9 years ago

In adapter League\Flysystem\Adapter\Local if the function normalizeFileInfo(SplFileInfo $file) is called and $file is unreadable due to permission issue then 'SplFileInfo::getType(): Lstat failed' Fatal Error is thrown.we can simply correct it by checking if the file is readable by ::

introducing a try catch block

or

if(!$file->isReadable()){ // do Something that avoids this fatal error //Or throw an exception which can be managed }

sebastiansulinski commented 9 years ago

+1 - same problem here

JarJak commented 6 years ago

Why closed?

dvcsiky commented 3 years ago

Why closed?

I answer this because it wasn't immediately apparent to me either. :smile:

Whilst there were no references to this issue anywhere, including the commit / any PR, and it was seemingly included within a "Coding Standards fix" commit, it was supposedly fixed with the linked commit in the closing notice.

Please check that commit, as well as remember that closed this in %x is supposed to mean fixed. (I will. :laughing: hopefully)

OTOH, I am still getting lstat failed issues, which are thus most probably not permission-related; will have to investigate further.

Uili-Simteau commented 3 years ago

Same issue here