diff --git a/omvs_main.c b/omvs_main.c index 1fb380f..ee1d28a 100644 --- a/omvs_main.c +++ b/omvs_main.c @@ -1,11 +1,13 @@ #include #include +#include +#include #include #include static gint _omvs_net_dev_idx; static gboolean _omvs_list_devs; -static gchar *_omvs_output = "omvs_out.txt"; +static gchar *_omvs_outdir = "omvs_out"; static gint _omvs_jobs = 1; static gint _omvs_sleep = 1000; static gint _omvs_timeout = 10000; @@ -23,8 +25,8 @@ static GOptionEntry _omvs_entries[] = "List network device interfaces", NULL }, { "jobs", 'j', 0, G_OPTION_ARG_INT, &_omvs_jobs, "Number of jobs", "jobs" }, - { "output", 'o', 0, G_OPTION_ARG_FILENAME, &_omvs_output, - "Output filename", "filename" }, + { "output", 'o', 0, G_OPTION_ARG_FILENAME, &_omvs_outdir, + "Output directory name", "dirname" }, { "sleep", 's', 0, G_OPTION_ARG_INT, &_omvs_sleep, "Sleep time(milliseconds) between scans", "ms" }, { "timeout", 't', 0, G_OPTION_ARG_INT, &_omvs_timeout, @@ -224,6 +226,8 @@ int main(int argc, char *argv[]) { gint idx_ipaddr; OMVSScanner omvs_scanner; + g_mkdir(_omvs_outdir, 0755); + if (_omvs_init_net_devs_info() != 0) { ret = -5; goto finish_return2;