Comments (7)
There's a similar problem with the -Xtime [-+]<n>
predicates, there the <n>
is not treated as an integer number of days and more like the -Xtime [-+]<n>d
of FreeBSD.
For instance -mtime 0
is meant to reports files last modified in the last 24 hours, while toybox find
only reports the ones last modified exactly now.
from toybox.
Busybox having behaved this way 2007 and nobody noticed seem that strong an argument. Do you have a use case that broke because of this?
512 seems irrelevant (minimum block size of ext2 was 1024 back in the 1990s, even fat32 defaults to at least 4k these days). If we gave m units presumably it should round to the megabyte?
from toybox.
Sharp edge here is that -size has any supplied units override the default (including c=bytes), but -time and -min don't (1kd days is 1000 days).
from toybox.
Debian's find -size also implicitly selects -type f.
from toybox.
Debian's find -size also implicitly selects -type f.
Why would it do that?
$ find . -size 5542c -prune -ls
258 0 drwxr-xr-x 1 chazelas chazelas 5542 Apr 25 19:29 .
$ find /etc/mtab -size 19c -prune -ls
187446 4 lrwxrwxrwx 1 root root 19 Jun 27 2021 /etc/mtab -> ../proc/self/mounts
$ find --version
find (GNU findutils) 4.9.0
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Eric B. Decker, James Youngman, and Kevin Dalley.
Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION FTS(FTS_CWDFD) CBO(level=2)
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux trixie/sid
Release: n/a
Codename: trixie
from toybox.
Busybox having behaved this way 2007 and nobody noticed seem that strong an argument. Do you have a use case that broke because of this?
512 seems irrelevant (minimum block size of ext2 was 1024 back in the 1990s, even fat32 defaults to at least 4k these days). If we gave m units presumably it should round to the megabyte?
It's quite well known busybox is not standard compliant and that one needs to adapt their script when porting to busybox.
Common denominator for block device block size is still 512 bytes.
But that's hardly relevant (and not the point of this question).
Find's -size <number-without-suffix>
is a well known almost 50 years old API which checks the size based on number of 512 byte units. If you want your tool to use different unit, don't call it find
or use a separate API that doesn't break backward compatibility like the find -size 12k
of FreeBSD or GNU (incompatible between themselves), or introduce a new one and convince other implementations to adopt it so it can be suggested as a standard to POSIX and used portably in a few decades.
from toybox.
But that's hardly relevant (and not the point of this question).
Find's
-size <number-without-suffix>
is a well known almost 50 years old API which checks the size based on number of 512 byte units. If you want your tool to use different unit, don't call itfind
or use a separate API that doesn't break backward compatibility like thefind -size 12k
of FreeBSD or GNU (incompatible between themselves), or introduce a new one and convince other implementations to adopt it so it can be suggested as a standard to POSIX and used portably in a few decades.
@stephane-chazelas while you have a point that there is deviation from the POSIX standard here, toybox
is only claiming reasonably standards-compliant and possible more inclined to follow busybox
compatiblity here.
also the POSIX standard is imprecise, vague or outright lacking in many places, having been the playground of many corporate interests in the past decades.
if you have an interesting solution to that problem, you can always submit a patch or pull request for review.
from toybox.
Related Issues (20)
- Request diff -I/--ignore-matching-lines
- [Documentation] Differences to busybox? HOT 3
- [Feature request] Could a static-option be added to the menu interface? HOT 5
- [Documentation / Question] Can toybox be combined with e. g. mruby? HOT 9
- building a rootfs without a kernel HOT 10
- Most scripts use /bin/bash, which not all systems have. Use /usr/bin/env instead? HOT 11
- [Q] Can `bash` compatibility in toysh be turned off during build time and during run time? HOT 2
- building 0.8.11 with ssl and tls is broken HOT 15
- When running shell scripts, the process coredump.
- POSIX deviation: test arithmetic operands must support decimal only HOT 12
- Can you include oksh? HOT 1
- On incremental builds' reproducibility HOT 1
- ASAN failures in various file processing commands HOT 2
- [Feature Suggestion] progress meter (pv subcommand) HOT 5
- [FR] envsubst HOT 4
- getty: does not display issue HOT 1
- command unshare broken HOT 1
- tar honor umask test fails on Android HOT 4
- Building Toybox for J2 Turtleboard fails since 650ff11a
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from toybox.