Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a stat DSL function #1560

Merged
merged 3 commits into from
May 9, 2024
Merged

Add a stat DSL function #1560

merged 3 commits into from
May 9, 2024

Conversation

johnkerl
Copy link
Owner

@johnkerl johnkerl commented May 8, 2024

For #1559.

Example:

cat stat-test.csv

path
mlr
./mlr
Makefile
.
..
/tmp/

mlr --c2p --from stat-test.csv put '$stat = stat($path)["size"]'

path     stat
mlr      38391584
./mlr    38391584
Makefile 4110
.        1440
..       1568
/tmp/    384
$ mlr --c2j --from stat-test.csv put '$stat = stat($path)'
[
{
  "path": "mlr",
  "stat": {
    "name": "mlr",
    "size": 38391584,
    "mode": 0755,
    "modtime": 1715207874,
    "isdir": false
  }
},
{
  "path": "./mlr",
  "stat": {
    "name": "mlr",
    "size": 38391584,
    "mode": 0755,
    "modtime": 1715207874,
    "isdir": false
  }
},
{
  "path": "Makefile",
  "stat": {
    "name": "Makefile",
    "size": 4110,
    "mode": 0644,
    "modtime": 1711459625,
    "isdir": false
  }
},
{
  "path": ".",
  "stat": {
    "name": ".",
    "size": 1440,
    "mode": 020000000755,
    "modtime": 1715208111,
    "isdir": true
  }
},
{
  "path": "..",
  "stat": {
    "name": "..",
    "size": 1568,
    "mode": 020000000755,
    "modtime": 1715003072,
    "isdir": true
  }
},
{
  "path": "/tmp/",
  "stat": {
    "name": "tmp",
    "size": 384,
    "mode": 020004000777,
    "modtime": 1715191674,
    "isdir": true
  }
}
]

@johnkerl johnkerl changed the title Add a stat DSL function [WIP] Add a stat DSL function May 9, 2024
@johnkerl johnkerl merged commit 5ac4851 into main May 9, 2024
6 checks passed
@johnkerl johnkerl deleted the kerl/stat branch May 9, 2024 22:39
@johnkerl johnkerl mentioned this pull request May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant