On Wed, Apr 26, 2023 at 07:41:56AM +0000, Albretch Mueller wrote: > This is not a debian question per se (more like a Linux bash one), > but I wasn't able to find an answer on the Internet. > > Here is first the problem I am having before you start reading a > conspiracy theory into it ;-) > > I need to somehow map URL on the web to a local file, but you can't > do that for two main reasons:
OK. [...] > but the file name (excluding the extension) is 306 characters long, > which Windows NTFS [...] There's the first problem. > a) encode the string name as base64 > b) calculate the sha256sum of §a Why the detour over base64? > c) use §b as file name (of course, leaving the original extension as it is) Why the extension? DOS nostalgia? > d) include a "§b_file_name.txt" plain text file decriptor which only > content is the actual prehash name of that file. OK. [...] > // __ $_SHA256: > |7d5895cb24ab49692a8ad495e036074fec8e61b22040544f02a9b69c926dbdeb -| I only see harmless hexadecimal chars there. > I am trying to avoid funky characters and sha256sum --text still > generates them!?! Where are there "funky chars"? > I work like this because I need replicate the original URL as a local > path in a way that would be compatible any file system. > > Do you know of a better way to deal with such issues? Besides, I don't think --text does what you think it does. Quoting the manpage: "Note: There is no difference between binary mode and text mode on GNU systems." This is about *reading* the input in text or binary mode, which are equivalent in most civilised operating systems. Cheers -- t
signature.asc
Description: PGP signature