MCPcopy Create free account
hub / github.com/byhook/ffmpeg4android / assert_file_overwrite

Function assert_file_overwrite

ffmpeg-single-cmd/src/main/cpp/ffmpeg_opt.c:833–860  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

831}
832
833static void assert_file_overwrite(const char *filename)
834{
835 if (file_overwrite && no_file_overwrite) {
836 fprintf(stderr, "Error, both -y and -n supplied. Exiting.\n");
837 exit_program(1);
838 }
839
840 if (!file_overwrite) {
841 const char *proto_name = avio_find_protocol_name(filename);
842 if (proto_name && !strcmp(proto_name, "file") && avio_check(filename, 0) == 0) {
843 if (stdin_interaction && !no_file_overwrite) {
844 fprintf(stderr,"File '%s' already exists. Overwrite ? [y/N] ", filename);
845 fflush(stderr);
846 term_exit();
847 signal(SIGINT, SIG_DFL);
848 if (!read_yesno()) {
849 av_log(NULL, AV_LOG_FATAL, "Not overwriting - exiting\n");
850 exit_program(1);
851 }
852 term_init();
853 }
854 else {
855 av_log(NULL, AV_LOG_FATAL, "File '%s' already exists. Exiting.\n", filename);
856 exit_program(1);
857 }
858 }
859 }
860}
861
862static void dump_attachment(AVStream *st, const char *filename)
863{

Callers 2

dump_attachmentFunction · 0.85
open_output_fileFunction · 0.85

Calls 4

exit_programFunction · 0.85
term_exitFunction · 0.85
read_yesnoFunction · 0.85
term_initFunction · 0.85

Tested by

no test coverage detected