Summary: | [NEW PORT] sysutils/frand: Selects a random file from given directory. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | serpent7776 | ||||||
Component: | Individual Port(s) | Assignee: | Rodrigo Osorio <rodrigo> | ||||||
Status: | Closed FIXED | ||||||||
Severity: | Affects Only Me | CC: | rodrigo | ||||||
Priority: | --- | ||||||||
Version: | Latest | ||||||||
Hardware: | Any | ||||||||
OS: | Any | ||||||||
Attachments: |
|
Hi, No offense, but what's the benefit of your tool compared to `find . -type f -maxdepth 1 | sort -R | head -n1` command line ? The reservoir-sampling algorithm provide some benefits here ? Regards, -- rodrigo No offense taken. The reservoir-sampling algorithm will provide benefit for big directories, as it doesn't require sorting input data. For most cases find+sort will do just fine though. I've created this port mainly for myself, so I can easily install this tool on my system. If you don't find this tool useful, I don't mind not including it is ports. I can always fallback to portshaker. At this points just two remarks: The algorithm used (reservoir-sampling) should be notified in the package description. And you should add a few words about the benefits of this solution in the long description aka pkg-descr. Created attachment 206553 [details]
shar archive with updated descriptions
A commit references this bug: Author: rodrigo Date: Sun Aug 18 10:34:08 UTC 2019 New revision: 509198 URL: https://svnweb.freebsd.org/changeset/ports/509198 Log: Add new port sysutils/frand frand is a command line tool who returns a random file from a given directory using the reservoir sampling algorithm. With reservoir sampling algorithm, directory contents doesn't need to be read in memory then sorted and so will perform much better than find+sort for directories with a large amount of files. PR: 239467 Submitted by: serpent7776@gmail.com Changes: head/sysutils/Makefile head/sysutils/frand/ head/sysutils/frand/Makefile head/sysutils/frand/distinfo head/sysutils/frand/pkg-descr head/sysutils/frand/pkg-plist Committed, thanks. |
Created attachment 206089 [details] shar archive with port files This is a small console utility that prints a random file name from given directory to standard output.