Changeset 0a509c6 for examples/utils.c


Ignore:
Timestamp:
Dec 8, 2013, 5:51:09 AM (10 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
664fd25
Parents:
a93dab3
Message:

examples/: check if sink_uri exists, add -f to force overwrite

File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/utils.c

    ra93dab3 r0a509c6  
    5454uint_t mix_input = 0;
    5555
     56uint_t force_overwrite = 0;
     57
    5658//
    5759// internal memory stuff
     
    8991    }
    9092    if (sink_uri != NULL) {
     93      uint_t sink_exists = (access(sink_uri, F_OK) == 0 );
     94      if (!force_overwrite && sink_exists) {
     95        outmsg ("Output file %s already exists, use -f to overwrite.\n",
     96            sink_uri);
     97        exit (1);
     98      }
    9199      this_sink = new_aubio_sink ((char_t*)sink_uri, samplerate);
    92100      if (this_sink == NULL) {
Note: See TracChangeset for help on using the changeset viewer.