- ret = utils_create_stream_file(path_name, stream_name, size, count, uid,
+ ret = snprintf(fullpath, sizeof(fullpath), "%s/" DEFAULT_INDEX_DIR,
+ path_name);
+ if (ret < 0) {
+ PERROR("snprintf index path");
+ goto error;
+ }
+
+ /* Create index directory if necessary. */
+ ret = run_as_mkdir(fullpath, S_IRWXU | S_IRWXG, uid, gid);
+ if (ret < 0) {
+ if (ret != -EEXIST) {
+ ERR("Index trace directory creation error");
+ goto error;
+ }
+ }
+
+ ret = utils_create_stream_file(fullpath, stream_name, size, count, uid,