Coder Social home page Coder Social logo

Comments (6)

mikey179 avatar mikey179 commented on August 19, 2024

Hm... I'm wondering why /tests/tmp has both .. and . while the other directories have .. only? Seems not very consistent to me. Wondering what the result would be on a Windows system.

from vfsstream.

mikey179 avatar mikey179 commented on August 19, 2024

Just tested on Windows. There, both .. and . are not listed. So the behaviour of vfsStream is the same as on a Windows system.

from vfsstream.

mikey179 avatar mikey179 commented on August 19, 2024

Same result on Mac OS, both .. and . are not listed.

from vfsstream.

mikey179 avatar mikey179 commented on August 19, 2024

Result on a VM running Ubuntu 12.04 64bit, PHP 5.4.6-2~precise+1:

/vagrant/mikey/vfsStream/tmp/.
/vagrant/mikey/vfsStream/tmp/..
/vagrant/mikey/vfsStream/tmp/Core/.
/vagrant/mikey/vfsStream/tmp/Core/..
/vagrant/mikey/vfsStream/tmp/Core/AbstractFactory/.
/vagrant/mikey/vfsStream/tmp/Core/AbstractFactory/..
/vagrant/mikey/vfsStream/tmp/Core/AbstractFactory/Invalid.csv
/vagrant/mikey/vfsStream/tmp/Core/AbstractFactory/other.php
/vagrant/mikey/vfsStream/tmp/Core/AbstractFactory/test.php
/vagrant/mikey/vfsStream/tmp/Core/AbstractFactory
/vagrant/mikey/vfsStream/tmp/Core/AnEmptyFolder/.
/vagrant/mikey/vfsStream/tmp/Core/AnEmptyFolder/..
/vagrant/mikey/vfsStream/tmp/Core/AnEmptyFolder
/vagrant/mikey/vfsStream7tmp/Core/badlocation.php
/vagrant/mikey/vfsStream/tmp/Core
vfs://root/Core/AbstractFactory/test.php
vfs://root/Core/AbstractFactory/other.php
vfs://root/Core/AbstractFactory/Invalid.csv
vfs://root/Core/AbstractFactory
vfs://root/Core/AnEmptyFolder
vfs://root/Core/badlocation.php
vfs://root/Core

So it seems Linux based systems behave definitely different compared to Win and Mac OS. I'm not sure what the consequences for vfsStream should be.

from vfsstream.

mikey179 avatar mikey179 commented on August 19, 2024

In case anyone has an opinion on how vfsStream should behave please share a comment here.

from vfsstream.

 avatar commented on August 19, 2024

Just an idea, but maybe vfsStream should mimic the behavior appropriate to the operating system that is being currently in use.

  • Linux: Yes ..
  • Mac: No ..
  • Windows: No ..

The above was based on an incorrect assumption. For example, scandir() returns the dot paths on all OSes.

Developers should have the option to mimic another OS if they want to override the default behavior.

The default should be to use dot paths, but allow developers to disable them.

vfsStream::useDotFiles(true); // force on, default
vfsStream::useDotFiles(false); // force off

The exact way of handling override could probably be done better.

I see this approach as being intuitive, and will not require that developers test against the behavior of vfsStream itself, just of the target OS.

from vfsstream.

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.