Re: File API cleanup
Peter Eisentraut <peter.eisentraut@enterprisedb.com>
From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2022-12-01T15:10:39Z
Lists: 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.)
Commits
-
Update types in smgr API
- b9f0e54bc955 16.0 landed
-
Add const to BufFileWrite
- faf3750657a8 16.0 landed
-
Remove unnecessary casts
- 5f2f99c9c62d 16.0 landed
- 07c29ca7fe30 16.0 landed
-
Update types in File API
- 2d4f1ba6cfc2 16.0 landed