new runc version
Posted 09-27-2013 at 03:53 PM by rainbowsally
Tags computer mad science, shell, simple c, utilities
Here's where runc can be d/loaded.
Run C/C++ Code As Script
http://www.linuxquestions.org/questi...-script-35691/
Here's another usage example for runc.
When you want to pack up a bunch of folders by name that live in a windows partition, there's a great likelihoold that spaces in the paths could cause a normal shell program to mis-parse the file names.
Runc uses C/C++ and the built-in slist functions (readng and writing to/from files and pipes) don't parse lines of text as args.
file: packall.runc
purpose: utility (executable)
If on a windows partition run this as
in lieu of being able to make it executable.
The Computer Mad Science Team
:-)
Run C/C++ Code As Script
http://www.linuxquestions.org/questi...-script-35691/
Here's another usage example for runc.
When you want to pack up a bunch of folders by name that live in a windows partition, there's a great likelihoold that spaces in the paths could cause a normal shell program to mis-parse the file names.
Runc uses C/C++ and the built-in slist functions (readng and writing to/from files and pipes) don't parse lines of text as args.
file: packall.runc
purpose: utility (executable)
Code:
#!/usr/local/bin/runc #include <runc.h> #include <stdlib.h> #include <stdio.h> int main(int argc, char** argv) { char cmd[256]; char** list = slist_new(); slist_pipeRead(&list, "find * -mindepth 0 -maxdepth 0 -type d"); for(int i = 0; i < slist_count(&list); i++) { char* line = slist_get(&list, i); sprintf(cmd, "tar -caf \"%s.tar.gz\" \"%s\"", line, line); system(cmd); } }
Code:
runc packall.runc
The Computer Mad Science Team
:-)
Total Comments 0