FreeCalypso > hg > freecalypso-sw
changeset 914:de0505be800d
fc-fsio: create-std-dirs implemented
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Tue, 08 Sep 2015 18:08:03 +0000 |
parents | 091ebd46a9cc |
children | 7b805007dcfc |
files | rvinterf/etmsync/Makefile rvinterf/etmsync/fscmdtab.c rvinterf/etmsync/stddirs.c |
diffstat | 3 files changed, 43 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/rvinterf/etmsync/Makefile Tue Sep 08 08:55:21 2015 +0000 +++ b/rvinterf/etmsync/Makefile Tue Sep 08 18:08:03 2015 +0000 @@ -6,7 +6,7 @@ FSIO_OBJS= connect.o dispatch.o fdcmd.o fileio.o fsbasics.o fscmdtab.o \ fserr.o fsiomain.o fsmisc.o fspath.o fsread.o fsupload.o \ fswrite.o interf.o launchrvif.o memcmd.o memops.o rfcap.o \ - symlink.o + stddirs.o symlink.o all: ${PROGS}
--- a/rvinterf/etmsync/fscmdtab.c Tue Sep 08 08:55:21 2015 +0000 +++ b/rvinterf/etmsync/fscmdtab.c Tue Sep 08 18:08:03 2015 +0000 @@ -30,9 +30,12 @@ extern int cmd_upload_file(); extern int cmd_upload_subtree(); +extern int create_std_dirs(); + struct cmdtab cmdtab[] = { {"cpout", 2, 2, cmd_cpout}, {"cpout-file", 2, 2, cmd_cpout_file}, + {"create-std-dirs", 0, 0, create_std_dirs}, {"delete", 1, 1, cmd_delete}, {"dieid", 0, 0, cmd_dieid}, {"exec", 1, 1, cmd_exec},
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rvinterf/etmsync/stddirs.c Tue Sep 08 18:08:03 2015 +0000 @@ -0,0 +1,39 @@ +/* + * An automated way to create the standard set of FFS directories + */ + +#include <sys/types.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <strings.h> +#include "exitcodes.h" + +static char *std_dir_list[] = { + "/gsm", + "/gsm/com", + "/gsm/rf", + "/gsm/rf/rx", + "/gsm/rf/tx", + "/pcm", + "/sys", + "/mmi", + "/var", + "/var/dbg", + "/aud", + "/etc", + 0 +}; + +create_std_dirs() +{ + char **dirp; + int rc; + + for (dirp = std_dir_list; *dirp; dirp++) { + rc = do_mkdir_existok(*dirp); + if (rc) + return(rc); + } + return(0); +}