-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathcross-os.summary.txt
104 lines (92 loc) · 7.29 KB
/
cross-os.summary.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
┏━━━━━━━━━━━━━━┓
┃ CROSS-OS ┃
┗━━━━━━━━━━━━━━┛
AVAILABLE UTILITIES ==> #Different core utils:
# - core OS syscalls are different
# - core utils are different, e.g. Windows has no coreutils nor Bash
# - usual application are different, e.g. `notepad.exe` instead of `vi` on Windows
#Windows emulations on Unix:
# - Wine
#Unix emulations on Windows:
# - msys/MinGW (part of Git Bash)
# - Cygwin: more extensive, similar to Wine but inverse
# - WSL (Windows Subsystem for Linux): alternative to Cygwin more focused on Linux
NEWLINE ==> #CR+LF on Windows, LR on Unix:
# - on terminal|file I/O
# - some applications (e.g. text editors) abstract this though
#'\n' is always LF and '\r' always CR (OS-agnostic)
SETTINGS/CONFIGURATION ==> #Different typical directories:
# - typical temporary directory: `/tmp` on Linux, `/var/folders/RANDOM/T` on Mac, `C:\Users\USER\AppData\Local\Temp` on Windows
# - typical home directory: `/home/USER` on Linux, `/Users/USER` on Max, `C:\Users\USER` on Windows
#Configuration:
# - Unix: usually files in some predefined directory like `/etc/*`
# - Windows: usually inside the Windows registry, a central key-value store
PATHS ==> #Delimiter is / on Unix, \ on Windows
# - although / is most of the time (but not always) allowed on Windows
#Absolute path on Windows:
# - '\' (current drive)
# - 'LETTER:\'
# - can use even with relative paths, e.g. `C:path` is relative but `C:\path` is not
# - '\\HOST\' or '//HOST\' ("UNC path")
SYMLINKS ==> #Windows:
# - can use `junctions`, i.e. like hard link but actually mirrors
# - cannot create hard links on folders
# - has a 'create symlink' permission, which by default is only given to admins
#FAT32 does not allow symlinks
PERMISSIONS ==> #Main mechanism is different:
# - Unix uses POSIX permissions (chmod(), umask(), stat().mode, etc.)
# - Windows use a combination of:
# - file attributes:
# - readonly: no write|delete permission (regular file only)
# - hidden:
# - not listed by parent directory
# - there are options to turn it off both in CLI and GUI, unless `system` attribute is also set
# - system: used by OS
# - directory: is directory
# - reparse point: is symlink
# - others are not related to file permissions
# - file permissions / ACLs / NTFS permissions
# - share permissions
#Executability on Windows:
# - means can be passed to an interpreter (since there is no shabang)
# - besides other permissions, also require extension to be among ENVVAR PATHEXT,
# a ;-separated list of file extensions
# - def: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
#User identification: UID|GID on Unix, SID on Windows
#Root on Unix, admin on Windows
COMMANDS EXECUTION ==> #Shabang does not work on Windows, i.e. must always use an iterpreter (e.g. `node FILE`)
# - exceptions: `*.exe|com|cmd|bat`
#File extension can be omitted if inside PATHEXT on Windows
#ENVVAR PATH:
# - delimiter is : on Unix and ; on Windows not :
# - different directories
SHELL ==> #cmd.exe is very different from Bash:
# - no ; but it has &&
# - flags use /OPT instead of "OPT"
# - escaping:
# - ^-escaping or "" for ^ & < > |
# - optional ^-escaping or "" for ' ` , ; = ( ) !
# - optional ^-escaping or "" for \-escaping for \ [ ] " . * ?
# - optional "-escaping for "
# - uses CP866 charset instead of Unicode
ENVVARS ==> #Referencing:
# - $ENVVAR in Unix, %ENVVAR% in Windows
# - if missing, '' in Unix, '%ENVVAR%' as is in Windows
#Passing:
# - ENVVAR=VAL in Unix
# - Set ENVVAR=VAL or setx ENVVAR VAL [/M] in Windows (/M if requires admin)
#Listing: `env` in Unix, `set` in Windows
#Referencing and passing is case-insensitive on Windows, case-sensitive on Unix
#Different names:
# - ComSpec on Windows, SHELL on Unix
# - PROMPT on Windows, PS1 on Unix
# - PWD in Unix, CD on Windows
# - HOME in Unix, HOMEDRIVE|HOMEPATH or USERPROFILE on Windows
# - TMPDIR in Unix, T[E]MP on Windows
# - USER on Unix, `USERDOMAIN\USERNAME` on Windows
# - COMPUTERNAME on Windows, HOSTNAME on Unix
# - can also use CLI command `hostname` (cross-OS)
INTER-PROCESS ==> #Windows does not have signals:
# - `taskkill` command can be used to terminate processes
#Signals integers are different between Linux and Mac, and some signals are different
NETWORKING ==> #Sockets/named pipes on Windows must be prefixed with `\\.\pipe\`