yeah I just feel it's kind of a weird question. One could also say why doesn't the shell try to treat echo $(ls) as the expansion of a variable named (ls). As if the shell is incapable of doing a little bit of logic on what follows $ in order to know how to treat it
I would have expected the same longest prefix match that makes cat <<(echo foo) an error instead of a redirection from a process substitution.
But other than Dash and Busybox, the shells I have actually do some guesswork with $( vs $((. In the others, echo $((echo hi); (echo ho)) prints hi ho instead of dropping an error for a totally broken arithmetic substitution.
Many of Apple's applications have files named with UUIDs. Often, they will put them into folders based on the prefix. For example, the "A" folder will contains all files with UUIDs starting with "A", the "B" folder with contain all files with UUIDs starting with "B". I am wondering why they do this. Does it somehow make file accessing quicker?
Does the file system take longer to read directories with large numbers of files?
We would like to store millions of text files in a Linux filesystem, with the purpose of being able to zip up and serve an arbitrary collection as a service. We've tried other solutions, like a key/value database, but our requirements for concurrency and parallelism make using the native filesys...
I was running into performance problems with hundredthousands of files in single directories when I needed to do certain wildcard matches. From my applications point of view, a simple solution is to place the files in deeply nested folders.
The expected upper bound for the total number of fol...
I have a web-site that I'm checking for performance issues and bugs, and i came across a caching code that caches thousands of files into one single directory.
I understand that this is not good and that I/O will degrade and i also heard about potential inode problem.
And i know how to fix the ...
In general, you want to avoid storing many thousands of files in a single directory. The approach with hashing the data and storing the files in two or three levels of subdirectories is a common workaround. It's not just Apple that does this.
The first time I came across this was when using the squid web proxy (in the 1990s?). It stores its cache files in this manner. The most recent example that I've come across is the backup repository managed by restic, in which the deduplicated data blobs are stored in a similar manner.
@MichaelHomer mm. On the other hand, every shell I tried gives an error for $((echo true)). I can't tell how that could be parsed as an arithmetic either, but I'm also not sure how that "shall only parse [as CS] [if can't parse as AE]" should be read...
@ilkkachu All the implementations seem to be just looking for unmatched ) prior to )), which doesn't really seem to go all the way there either, but it's an attempt. Interesting cases are echo $((echo 1;(:)) ) and $((foo(){ :;}))
I learned about "thousands of files in one directory (on ext4)" the hard way. Took me half an hour to find out where that 40 MB came from in an empty directory.