1,909 karma · joined Sep 24, 2012 (14y ago) · 1,011 submissions
comment 6y ago · link · parent
comment 6y ago · link · parent
I don't think this is particularly useful. For professional accounting purposes, uncashed outgoing checks are liabilities, meaning that in general, the company cannot spend that money to do other things. If you want them to keep the money, you need to tell them that. Otherwise, the money effectively gets split between the bank and the government.
comment 6y ago · link · parent
extract() {
bsdtar -xf "$1"
}
you can decompress things which are not files, such as stdin or device files. in addition, your code does not cover *.tar.xz (more common than tar.bz2 nowadays), or lzma, or lz4, or tar.zst, or many many other formats. further, it's not even consistent: bunzip2, gunzip, and unxz remove the input file, but tar, unrar, 7z, and zstd do not.comment 6y ago · link · parent
comment 6y ago · link · parent
Linux already semi-supports this with chattr +a, which is filesystem-specific, plus filesystem-specific mount options (e.g. data=journal). unfortunately, implementing the latter is non-trivial to do on a per-file basis.
> - Temp files. Not persistent over restarts. Not backed up. Can be memory-mapped as read/write. On a crash, disappears.
O_TMPFILE exists on Linux, and I don't know of any reason why it couldn't be added to POSIX.
> - Managed files. These are for databases. Async I/O available. May have additional locking functions. Separate completion returns for "accepted data" (caller can reuse write buffer) and "committed data" (safely stored), so the database knows when the data has been safely stored. Can be memory-mapped as read/write. Intended for use by programs which are very aware of the file system semantics. On a crash, "committed data" should be intact but data not yet committed may be lost.
io_uring exists now.
these features are Linux-specific, but my point is that these features do exist now already, there is no need to wish for them.
comment 6y ago · link · parent
uh? assuming you already have a working C toolchain and JDK installed, you just hg^Wgit clone; bash configure; make.
edit: you may have more trouble compiling it on windows, but compiling anything on windows is a pain unless it uses the entire proprietary non-portable microsoft-specific project management tools.
comment 6y ago · link · parent
This definitely doesn't sound right. Running strace, you need to specify -f in order to trace threads, otherwise only the main thread is traced. gdb does stop all threads on interrupts, but only by default for convenience, and I don't think it's atomic.
Because of this, LD_PRELOAD is not the easiest way to delay system calls, strace -e inject:delay is.
$ cat > a.c << EOF
#include <stdio.h>
#include <sys/types.h>
#include <fcntl.h>
#include <pthread.h>
#include <unistd.h>
void *start_thread(void *arg) {
while (1) {
puts("thread");
sleep(1);
}
}
int main() {
pthread_t thr;
pthread_create(&thr, NULL, start_thread, NULL);
while (1) {
puts("main");
close(open("/dev/null", O_RDONLY));
sleep(1);
}
}
EOF
$ gcc a.c
$ strace -o /dev/null -P /dev/null -e inject=openat:delay_enter=3s ./a.out
main
thread
thread
thread
thread
thread
main
thread
thread
thread
thread
thread
[ and so on. ]comment 6y ago · link · parent
comment 6y ago · link · parent
> A "Ventoy Compatible" concept is introduced by ventoy, which can help to support any ISO file.
from the "Ventoy Compatible" page:
> From the document you can see that ventoy will create a virtual disk from the iso file and boot it. But the virtual disk is only on BIOS(Legacy or UEFI) level. In most case it works only in bootloader period. Most of the morden OS's kernels will use their driver to access hardware after boot, so the virtual disk will not be visible to them. In normal case, the OS will search all the hardware storage media(CDROM/USB/HD ...) to find the source medium. But with ventoy they will not find such medium because there is no such physical media and they don't know that they were booted from a virual disk. In order to support that ventoy must do some hook before boot. But the hook is really a hard work because there are so many different OS distros and so many special cases.
comment 6y ago · link · parent
comment 6y ago · link · parent