| 831 | } |
| 832 | |
| 833 | static 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 | |
| 862 | static void dump_attachment(AVStream *st, const char *filename) |
| 863 | { |
no test coverage detected