Re: [HACKERS] How to refer to resource files from UDFs written in C
В списке pgsql-hackers по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: [HACKERS] How to refer to resource files from UDFs written in C |
| Дата | |
| Msg-id | 24523.1497015905@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | [HACKERS] How to refer to resource files from UDFs written in C (Supun Nakandala <supun.nakandala@gmail.com>) |
| Список | pgsql-hackers |
Supun Nakandala <supun.nakandala@gmail.com> writes:
> However, I have a requirement of reading a text file from one of the C
> functions. The compiled *.so files are placed in the "pg_config
> --pkglibdir" directory and tried copying my text files there but it didn't
> work. I found that, when these shared libs are loaded they are run from a
> different working directory. In this case, what is the best way to refer to
> my text files from the C code other than giving the absolute path which can
> change from system to system.
You probably want to use get_share_path, or one of its sibling functions
in src/port/path.c. Then your files go with the PG installation tree,
whereever it is. There are different functions that are appropriate for
different types of files.
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера