Giter Site home page Giter Site logo

attribute mode about luafilesystem HOT 6 OPEN

lunarmodules avatar lunarmodules commented on June 15, 2024
attribute mode

from luafilesystem.

Comments (6)

hishamhm avatar hishamhm commented on June 15, 2024

Agree that the name is unfortunate, but the lfs API has been there for a long time, it would break lots of stuff if it was changed. What's being proposed here exactly?

from luafilesystem.

justincormack avatar justincormack commented on June 15, 2024

You could add a new (preferred) name, and mark the existing one as deprecated.

from luafilesystem.

hishamhm avatar hishamhm commented on June 15, 2024

I agree the name is a bit odd and I wouldn't have chosen it myself, but IMO I don't think the change is worth the hassle: people would write code with the new name, and then users with existing installs of lfs are forced to upgrade just because of that one string, but not after some breakage and headscratching (especially in a dynamically typed language, where things fail at runtime, often silently).

from luafilesystem.

justincormack avatar justincormack commented on June 15, 2024

Thats why you transition it over a number of versions... the alternative is not to change anything (the other thing thats ugly is the iterator spec for directory traversal which looks like it was developed for an earlier version of Lua and adapted).

The problem is that these older projects (luasocket, luaposix and this one) are copied as APIs by newer stuff too (eg openresty copies the luasocket interface) as models for how Lua interfaces should be. So we should be trying to improve them, and defining a specification.

One model would be that they could change in sync with core language changes, so there could be a release for 5.3 with changes, as people will need to update their code then anyway, as the language does not have full compatibility.

from luafilesystem.

mpeterv avatar mpeterv commented on June 15, 2024

We should rename 'mode' in lfs 2.0 and leave the old name supported but deprecated. What's the preferred new name, 'filetype' or just 'type'?

from luafilesystem.

jerome-diver avatar jerome-diver commented on June 15, 2024

i don't know, but for me, on archlinux, and installed by luarocks, attributes functions doesn't return nothing (mode or not). empty table for file or for directory entry.
I find why... i follow the doc, but in fact the doc doesn't said that the option of attribute should be a string: 'mode'. I'm newbie on lua. I think the doc should maybe give options surrounded by '' for be almost clear for everybody.

from luafilesystem.

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.