[HN Gopher] Regex2fat: Turn your favorite regex into FAT32
       ___________________________________________________________________
        
       Regex2fat: Turn your favorite regex into FAT32
        
       Author : beefhash
       Score  : 256 points
       Date   : 2020-04-15 14:53 UTC (8 hours ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | bryan_w wrote:
       | This reminds me of that Lewis black bit, "If it weren't for my
       | horse, I never would have spent that year in college".
       | 
       | I saw the words, but my brain couldn't process them, no matter
       | how many times I tried.
       | 
       | If I die of an aneurysm, regex2fat will probably be the reason
       | why
        
         | TeMPOraL wrote:
         | I don't understand, what's the deal with that Lewis sentence?
         | 
         | It seems pretty straightforward to parse. I read it as:
         | if(!somethingAboutMyHorse) {         // ? Road not taken.
         | } else {         //Spend a year in college.       }
        
           | projektfu wrote:
           | Without being able to process the words in some way, put them
           | into context, it can cause an aneurism to rupture in his
           | brain.
        
           | ssalazar wrote:
           | Never heard this before but despite being grammatically
           | sound, I guess the events that would lead to someone
           | truthfully saying it are meant to defy reason.
        
           | nathancahill wrote:
           | The horse raced past the barn fell.
        
       | superasn wrote:
       | What happens if I my regex contains aux.h?
        
         | klodolph wrote:
         | It will show up as something like /A/U/X/DOT/H
        
         | the8472 wrote:
         | Add the file namespace prefix
         | 
         | https://docs.microsoft.com/en-us/windows/win32/fileio/naming...
        
       | [deleted]
        
       | sunsu wrote:
       | All In: "Haha OS-driven regex engine go brrrrr"
        
         | nayuki wrote:
         | Indeed, a current meme. https://knowyourmeme.com/memes/money-
         | printer-go-brrr
        
       | wmu wrote:
       | There's the first issue: "`regex2fat` is nine characters long"
       | (https://github.com/8051Enthusiast/regex2fat/issues/1) :)
        
         | Xenograph wrote:
         | Could someone explain the joke?
        
           | binarytox1n wrote:
           | https://en.wikipedia.org/wiki/8.3_filename
           | 
           | > "A SFN filename can have at most 8 characters before the
           | dot. If it has more than that, the first 6 must be written,
           | then a tilde '~' as the seventh character and a number
           | (usually 1) as the eighth. The number distinguishes it from
           | other files with both the same first six letters and the same
           | extension."
        
           | why-oh-why wrote:
           | It's a fat joke.
        
       | Darkphibre wrote:
       | I read this first as "Turning your Registry into FAT32" and
       | thought... oh, no. You do _not_ want to do that.
       | 
       | Regex though... this is humorous.
        
       | acheron wrote:
       | Now you have... quite a few problems.
        
       | Aloha wrote:
       | This strikes me as a project that was created while drunk or
       | high, probably high, possibly both.
        
         | asdfman123 wrote:
         | I don't know about you, but some of us can generate a rich
         | stream of dumb and useless ideas without the aid of substances.
        
           | Aloha wrote:
           | I can generate those ideas sober just fine, its the _doing_
           | them part that requires the substances.
        
             | [deleted]
        
         | elteto wrote:
         | He must have reached Ballmer's Peak (https://xkcd.com/323/)
        
       | [deleted]
        
       | duskwuff wrote:
       | This is a horrifying abuse of a filesystem, and I love it.
        
       | a_c wrote:
       | Hey thanks for the project! I (thought I) know what regex is, and
       | I (thought I) know what FAT32 is. But Bamm! putting the two
       | together, the whole sentence makes no sense to me.
       | 
       | This is genius.
        
       | yjftsjthsd-h wrote:
       | > Q: Should I use this in production^w^w anywhere?
       | 
       | > A: No, but I can't stop you.
       | 
       | The motto of so many of the best projects:)
        
       | buildbot wrote:
       | This is hilarious! I was excited hoping that it was a fuse file
       | system that let you mount a view of another file system with
       | regex though, something that would be a pretty useful tool.
        
         | fit2rule wrote:
         | I also wondered the same .. if it weren't some generalised way
         | to apply regex to implement FAT32 (read and write) .. instead I
         | think its a mapping of DFA to dentry semantics. Still pretty
         | neat.
        
       | codegladiator wrote:
       | Can I parse HTML with this ?
        
         | jasonjayr wrote:
         | https://stackoverflow.com/questions/1732348/regex-match-open...
        
         | brazzy wrote:
         | Only if you are adequately insured against the accidental
         | summoning of a Great Old One.
        
       | rwmj wrote:
       | If you think this is crazy, check out the VVFAT driver in
       | qemu[1]. At first sight it seems simple enough - turn a host
       | directory into a virtual FAT filesystem which is presented to the
       | guest.
       | 
       | The clever/insane thing is it supports writes. It is able to
       | "reverse" those block level operations from the guest to modify
       | the source filesystem on the host.
       | 
       | It was written by the ever exceptional Fabrice Bellard. EDIT: No
       | it wasn't, it was written by Johannes Schindelin, thanks for the
       | clarification in replies.
       | 
       | [1] https://github.com/qemu/qemu/blob/master/block/vvfat.c
        
         | beholder1 wrote:
         | I see another name as author and no trace of Fabrice in
         | history. Can you elaborate please?
        
           | loeg wrote:
           | QEMU itself came from Bellard originally, but I believe you
           | are correct that the RO and RW vvfat support came from
           | Johannes Schindelin:
           | 
           | https://github.com/qemu/qemu/commit/de167e416fa3d6e4bbdcac90.
           | ..
           | 
           | https://github.com/qemu/qemu/commit/a046433a161a1f554be55df8.
           | ..
        
         | lifthrasiir wrote:
         | > It was written by the ever exceptional Fabrice Bellard.
         | 
         | I think it is rather by Johannes Schindelin [1].
         | 
         | [1]
         | https://github.com/qemu/qemu/commit/de167e416fa3d6e4bbdcac90...
        
           | yellowapple wrote:
           | On the other hand, I don't think we've ever seen Fabrice
           | Bellard and Johannes Schindelin in the same room together.
        
             | lifthrasiir wrote:
             | That is... compelling, I admit, as Bellard was known for
             | his use of various pseudonyms (e.g. Gerard Lantau for
             | FFmpeg). But I guess Schindelin now works for Microsoft
             | while Bellard still works for Amarisoft [1], right?
             | 
             | [1] https://www.amarisoft.com/about-us/
        
               | giantrobot wrote:
               | But if you rearrange, remove, and then add some letters
               | to Amerisoft it spells MicroSoft. The implication is
               | clear.
        
       | russtrotter wrote:
       | I love these kinds of projects! Any description of it that has me
       | cackling by the 2nd sentence is gonna be a gem. Good thing i
       | brought my FAT32 driver.
        
       | Rokid wrote:
       | What is this? I'm so curious but nothing of this rings a bell
       | with me. I mean I know what a regular expression is, and I've
       | formatted several USBs to FAT32, but DFAs and everything in
       | between have me Googling like crazy, still in the dark though.
        
         | slondr wrote:
         | RegExp and DFAs are the same computation class, so it's useful
         | sometimes to model them as each other.
        
           | Pmop wrote:
           | No idea why you're being downvoted. Also, classical comp. sci
           | technique of reducing your problem into another that's
           | already been solved (with good enough time/mem bounds).
        
         | nicholaides wrote:
         | It converts your regexp into a virtual filesystem and then you
         | can test if a string matches the regexp by converting the
         | string into a path and testing if that path is contained in the
         | filesystem.
        
           | itronitron wrote:
           | Presumably this is useful if you can place files into (or
           | modify a file at) the location for a particular regexp.
        
             | Someone wrote:
             | That wouldn't work. This works by hard linking a lot of
             | directories to each other, so if you were to write a file
             | there, it ends up in multiple locations (possibly all
             | 'directories' in the file system)
             | 
             | The file system could work around that by creating new
             | unique directories whenever you write any file to an empty
             | directory, but that would require it to keep the regular
             | expression it represents around, and would fill up the file
             | system quite rapidly.
        
         | adrianmonk wrote:
         | This was what made it all make sense for me:
         | 
         | https://perl.plover.com/Regex/article.html
        
       | jimrandomh wrote:
       | I think this could also be built out of symlinks in a Linux
       | filesystem. This would be slightly more practical (though, of
       | course, still not practical at all).
        
         | gumby wrote:
         | "Slightly more expressive" as you can create longer filenames
         | with most Linux filesystems and more entries too.
         | 
         | I like that phrase as it sounds like "better" when we're
         | talking about, as you say, something wonderfully useless.
        
         | Dylan16807 wrote:
         | As long as you don't mind the depth limit of 40 symlinks on
         | Linux and I think 31 on Windows.
        
       | sonofgod wrote:
       | /A/A/A/A/A/A/A/A/A/A/A/A/A/H/H/H/H/MATCH
        
       ___________________________________________________________________
       (page generated 2020-04-15 23:00 UTC)