Earlier quoted context omitted.
Which is how you do the fun spinny icons on the command line without having to invoke ncurses!
You can also just use a \r directly without a \n. For example: spin='/-\|' while true; do i=$(( (i+1) % 4 )) printf "\r${spin:$i:1} Working..." sleep 0.1 done
How do I inform Windows that I'm writing a binary file?
71–74 of 74 posts
Re: How do I inform Windows that I'm writing a binary file?
#72Earlier quoted context omitted.
It still shows up in IETF-style textual network protocols, which evolved on non-Unix systems (HTTP, SMTP, etc.)
MTA-STS, a very recent standard (RFC 8461), only allows CRLF as the line terminator (to the chagrin of *nix lovers, and to the fact that a majority of mail systems are being operated on *nix systems)
Re: How do I inform Windows that I'm writing a binary file?
#73Re: How do I inform Windows that I'm writing a binary file?
#74Earlier quoted context omitted.
> The Win32 API. E.g. using WriteFile to write files ( https://learn.microsoft.com/en-us/windows/win32/api/fileapi/ ...) Which is called from what, if not C? Does windows really offer no API for writing text (rather than bytes) to files? Or does it rely on the application developer to manage line endings in their own code? Neither of those sounds very developer-friendly.
From literally any language. The WriteFile function comes from kernel32.dll shared library, and follows the certain calling convention. You don't need to use this calling convention inside your own binary (and indeed, MinGW and MSYS use SysV ABI for everything except when calling Win32 API), or ask a random C runtime coming from God knows where to do this for you if you write something other than C. In the UNIX world…
64-bit Cygwin/MSYS2 uses a modified MS ABI where `long` is 64-bits.