Crates.io | mkcd |
lib.rs | mkcd |
version | 0.8.6 |
source | src |
created_at | 2022-12-18 10:41:28.337864 |
updated_at | 2023-02-01 23:20:16.570769 |
description | if mkdir and cd were mixed together |
homepage | |
repository | |
max_upload_size | |
id | 740324 |
size | 4,392 |
A cli that does not work;
It does not work because of the way that unix handles processes. When you invoke a command in the CLI, the process that handled that prompt (be it cd or echo)
┌─────────┐ ┌──────────┐ ┌─────────┐ │ │ │ │ │ │ │ shell ├──►│ fork() ├────┬───►│ shell │◄──────────────────────── mkcd canot access this │ │ │ │ │ │ │ │ └────▲────┘ └──────────┘ │ └─────────┘ │ │ │ │ │ │ │ │ │ ┌────────────────┐ ┌─────────────┐ ┌────────┐ │ │ │ │ │ │ │ │ │ └────► copy of shell ├────►│ exec(mkcd) ├─────► mkcd │ │ │ │ │ │ │ │ │ └────────────────┘ └─────────────┘ └─────┬──┘ │ │ │ │ └──────────────────────────────────────────────────────────────────────────────┘