Skip to content

Conversation

@moose-kazan
Copy link
Contributor

Hi!

This PR add support for brotli-compressed files.

@github-actions github-actions bot added needs triage Needs triage by maintainers prio: medium Has the potential to affect progress labels Oct 29, 2025
@github-actions github-actions bot added this to the Future Releases milestone Oct 29, 2025
@zyv zyv added area: vfs Virtual File System support and removed needs triage Needs triage by maintainers labels Oct 30, 2025

br_list() {
BROUTFILENAME=$(basename "${BRFILENAME}" | sed -e 's/\.br$//')
ls -l --time-style="+%m/%d/%Y %H:%M:%S" "${BRFILENAME}" | \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, --time-style is not POSIX, and I don't have it on macOS and BSD. Can't you use Perl like here?

perl -MPOSIX -le '...'

sub ls {
my ($file,$path,$mode) = @_;
if (-f $file) {
my @stat = stat(_);
# mode, nlink, uid, gid, size, mtime, filename
printf "%s %d %d %d %d %s %s\n", $mode || ft($file).fm($stat[2] & 07777),
$stat[3], $stat[4], $stat[5], $stat[7], bt($stat[9]), $path;
}
}

Then you also won't need awk.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea!

I was rewrite code in Perl (see new commit).

offtop: for future cases: which language preferred for similar tasks? It seems to me that it bash. But if you recommend Perl - i will use it with pleasure. I well know and much like Perl.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good question, but I don't have an equally good answer.

Historically, extfs modules were written in any language that the contributors saw fit and the maintainers would accept. The majority were written in shell, but some "complicated" modules were written in Perl or Python.

My long-term vision would be to provide an ECMAScript execution engine and have them re-written in ECMAScript. It will speed up the modules dramatically, the language is better than the mix of shell with other POSIX tools, we could have sane tests for the modules, there is an ecosystem of development tools, etc. If and when this will happen, I don't know.

For now, my strategy was to accept modules that work on POSIX systems if they are written "the old way", and Python/Perl modules if they are not expected to be used on machines like routers featuring Busybox and lacking most common interpreters.

In this case, I think Perl is okay, because it's unlikely that anyone would want to use Brotli VFS in this context. Also, I don't know Perl and I don't like it, but it seems to me that it looks much cleaner than the shell attempt now.


br_list() {
BROUTFILENAME=$(basename "${BRFILENAME}" | sed -e 's/\.br$//')
ls -l --time-style="+%m/%d/%Y %H:%M:%S" "${BRFILENAME}" | \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good question, but I don't have an equally good answer.

Historically, extfs modules were written in any language that the contributors saw fit and the maintainers would accept. The majority were written in shell, but some "complicated" modules were written in Perl or Python.

My long-term vision would be to provide an ECMAScript execution engine and have them re-written in ECMAScript. It will speed up the modules dramatically, the language is better than the mix of shell with other POSIX tools, we could have sane tests for the modules, there is an ecosystem of development tools, etc. If and when this will happen, I don't know.

For now, my strategy was to accept modules that work on POSIX systems if they are written "the old way", and Python/Perl modules if they are not expected to be used on machines like routers featuring Busybox and lacking most common interpreters.

In this case, I think Perl is okay, because it's unlikely that anyone would want to use Brotli VFS in this context. Also, I don't know Perl and I don't like it, but it seems to me that it looks much cleaner than the shell attempt now.

@zyv zyv requested a review from mc-worker October 31, 2025 08:55
Signed-off-by: Vadim Kalinnikov <moose@ylsoftware.com>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: vfs Virtual File System support prio: medium Has the potential to affect progress

Development

Successfully merging this pull request may close these issues.

2 participants