Re: File API cleanup

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: File API cleanup
Дата
Msg-id 4ee0c899-c7fd-d3af-0800-0c1b5067c7e5@enterprisedb.com
обсуждение исходный текст
Ответ на Re: File API cleanup  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Список pgsql-hackers
On 01.12.22 09:55, Bharath Rupireddy wrote:
> can we have a generic,
> single function file_exists() in fd.c/file_utils.c so that both
> backend and frontend code can use it? I see there are 3 uses and
> definitions of it in jit.c, dfmgr.c and pg_regress.c. This will reduce
> the code duplication. Thoughts?

Well, the first problem with that would be that all three of those 
implementations are slightly different.  Maybe that is intentional, or 
maybe not, in which case a common implementation might be beneficial.

(Another thing to consider is that checking whether a file exists is not 
often actually useful.  If you want to use the file, you should just 
open it and then check for any errors.  The cases above have special 
requirements, so there obviously are uses, but I'm not sure how many in 
the long run.)




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Documentation for building with meson
Следующее
От: Peter Eisentraut
Дата:
Сообщение: pg_upgrade: Make testing different transfer modes easier