perlffi / ffi-c-stat Goto Github PK
View Code? Open in Web Editor NEWObject-oriented FFI interface to native stat and lstat
Object-oriented FFI interface to native stat and lstat
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.