[FFmpeg-devel] url_exists function in avio.c opens instead of checking existence

Maker aka Michele maker.py
Tue Jan 19 23:33:37 CET 2010

> What about a url_check(file, flag) function, which checks if it is
> possible to open a file/url with a certain mode?
> Then we could deprecate url_exist() and use that instead.
> Yeah, it would solve the problem with pipe output (like you said, opening
in write_only). But what about files in 000 mode?
Also, how to recognize a fifo file? there would be so many nested if to make
that function complicated - and just for an exception.

Uh, and  now, with ffmpeg:

$ touch some_movie.mp4
$ chmod 000 some_movie.mp4
$ chmod +r some_movie.mp4
$ ffmpeg -i foo.avi -f mp4 [...] some_movie.mp4
File 'some_movie.mp4' already exists. Overwrite ? [y/N] y
Could not open 'some_movie.mp4'

It seems that ffmpeg already manages output write-protected. Shouldn't it be
duplicate code?

More information about the ffmpeg-devel mailing list