Changeset 41
- Timestamp:
- 10/30/2008 10:45:34 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
SH_SHM/trunk/source/seed_io/sfd2db.c
r38 r41 3 3 * ======== 4 4 * 5 * $Revision: 2 3 $, $Date: 2008-02-05 12:56:20 +0100 (Di, 05Feb 2008) $5 * $Revision: 26 $, $Date: 2008-02-11 16:00:39 +0100 (Mo, 11 Feb 2008) $ 6 6 * 7 7 * reads lines from sfdfile and creates commands to insert into sfdb database … … 42 42 char abspath[cBcFileLth+1]; /* path to sfdfile */ 43 43 char sfdbreq[cBcLineLth+1]; /* request command to sfdb database */ 44 char sfdbreqscriptfile[cBcLineLth+1]; /* request command to sfdb database for executing statements in a scriptfile*/ 44 45 char *env; /* pointer to environment */ 45 46 char shellcmd[cBcLongStrLth+1]; /* shell command */ … … 99 100 strcpy( sfdbreq, env ); 100 101 } /*endif*/ 102 103 env = (char *)getenv( "SFDBREQSCRIPTFILE" ); 104 if (env == NULL) { 105 strcpy( sfdbreqscriptfile, "mysql" ); 106 } else { 107 if (strlen(env) > cBcLineLth) { 108 fprintf( stderr, "%s: SFDBREQSCRIPTFILE too long. Abort.\n", argv[0] ); 109 return 1; 110 } /*endif*/ 111 strcpy( sfdbreqscriptfile, env ); 112 } /*endif*/ 113 101 114 102 115 /* temporary file */ … … 325 338 /*sprintf( shellcmd, "cat %s", tmpfile );*/ 326 339 /*system( shellcmd );*/ 327 sprintf( shellcmd, " sql sfdb <%s", tmpfile );340 sprintf( shellcmd, "%s sfdb < %s", sfdbreqscriptfile, tmpfile ); 328 341 /*printf( "--> executing %s\n", shellcmd );*/ 329 342 system( shellcmd );
Note: See TracChangeset
for help on using the changeset viewer.