Coder Social home page Coder Social logo

ffi-c-stat's People

Contributors

plicease avatar

Watchers

 avatar  avatar

ffi-c-stat's Issues

Support higher resolition timestamps

Linux, FreeBSD and probably other support higher resolution timestamps in stat. It would be nice to expose them in this class. Caller can use can method to see if the higher resolution is available.

t/ffi_c_stat.t fails on FreeBSD systems

On newer FreeBSD systems (version 12, 13, 14) the test suite fails:

t/ffi_c_stat.t .. 1/?
# Failed test 'do a stat on a regular file'
# at t/ffi_c_stat.t line 30.
# +--------+------------------------+----+------------------------+--------+
# | PATH   | GOT                    | OP | CHECK                  | LNs    |
# +--------+------------------------+----+------------------------+--------+
# |        | FFI::C::Stat=SCALAR(0x |    | <OBJECT>               | 25, 29 |
# |        | 801bbe210)             |    |                        |        |
# |        |                        |    |                        |        |
# | dev()  | 12873038014975195776   | eq | -5573706058734355840   | 484    |
# | rdev() | 18446744073709551615   | eq | -1                     | 484    |
# +--------+------------------------+----+------------------------+--------+

# Failed test 'clone a stat'
# at t/ffi_c_stat.t line 40.
# +--------+------------------------+----+------------------------+--------+
# | PATH   | GOT                    | OP | CHECK                  | LNs    |
# +--------+------------------------+----+------------------------+--------+
# |        | FFI::C::Stat=SCALAR(0x |    | <OBJECT>               | 35, 39 |
# |        | 801bbe4c8)             |    |                        |        |
# |        |                        |    |                        |        |
# | dev()  | 12873038014975195776   | eq | -5573706058734355840   | 484    |
# | rdev() | 18446744073709551615   | eq | -1                     | 484    |
# +--------+------------------------+----+------------------------+--------+
... etc ...

However, I think FFI::C::Stat is correct here. Calling the stat utility on the test file outputs the following:

$ stat -r corpus/xx.txt
12873038014975195776 6165556 0100644 1 1023 1023 18446744073709551615 3 1622313704 1622155269 1622313704 1622155269 4096 9 2048 corpus/xx.txt

So my interpretation is that perl's stat is broken.

FreeBSD seems to use 64 bits for dev and rdev now. This changed either in version 11 or 12; on my FreeBSD 9 and 10 smokers the test suite passes, and I don't have 11 available.

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.