python makedirs.py -f input.txt -o output.txt -indent 4From a given txt file of directories and/or files structured by indentation generate a sh script that can create that directory tree. Be carefull with indentation.
Example:
| package hook | |
| import "core:fmt" | |
| import "core:intrinsics" | |
| import "core:mem" | |
| import "core:os" | |
| import "core:runtime" | |
| import "core:strings" | |
| import win32 "core:sys/windows" |
| def is_anagram(s1, s2): | |
| if len(s1) != len(s2): | |
| return False | |
| result = 0 | |
| for c1, c2 in zip(s1, s2): | |
| result ^= ord(c1) ^ ord(c2) | |
| return result == 0 |
| #include <stdio.h.> | |
| #include <windows.h> | |
| #include <processthreadsapi.h> | |
| DWORD WINAPI ThreadFn(PVOID param); | |
| struct Inner { | |
| const char* innerName; | |
| int result; |
| use std::ffi::CStr; | |
| use windows_sys::{ | |
| core::*, Win32::Foundation::*, Win32::System::Diagnostics::Debug::*, | |
| Win32::System::Diagnostics::ToolHelp::*, Win32::System::LibraryLoader::*, | |
| Win32::System::Memory::*, Win32::System::StationsAndDesktops::*, Win32::System::Threading::*, | |
| Win32::UI::WindowsAndMessaging::*, | |
| }; | |
| fn get_pid(process: &str) -> Result<u32, &'static str> { | |
| unsafe { |
| #include <windows.h> | |
| #include <tlhelp32.h> | |
| #include <stdio.h> | |
| DWORD GetPid(const char* processName) { | |
| HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); | |
| if (snapshot == INVALID_HANDLE_VALUE) { | |
| printf("Snapshot error: %lu\n", GetLastError()); | |
| return 0; | |
| } |
| #include <stdio.h> | |
| #include <windows.h> | |
| #include <tlhelp32.h> | |
| #include <wtsapi32.h> | |
| #pragma comment(lib, "wtsapi32") | |
| void EnumProcToolhelp() { | |
| HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); | |
| if (snapshot == INVALID_HANDLE_VALUE) |
| def flatten_dict_aux(data, acc, get="kv"): | |
| if isinstance(data, list): | |
| for lst in data: | |
| flatten_dict_aux(lst, acc, get) | |
| elif isinstance(data, dict): | |
| for k, v in data.items(): | |
| if isinstance(v, list) or isinstance(v, dict): | |
| flatten_dict_aux(v, acc, get) | |
| # delete this else to get all keys even keys with dict and arrays | |
| else: |