I'm trying to write a function in C that I can load into postgres,
that basically removes a file from the system (quite unsafe thought, but
it'll be suitable for me here):
bool file_remove(text *this)
if (remove((char *)this) == 0) return (true);
else return (false);
I compile it and link as instructed for Solaris (where the backend
runs), and load it with:
CREATE FUNCTION file_remove(text) RETURNS bool AS '/path/file_remove.so'
But it always returns false when I try to remove something. I'm sure
that I'm trying to remove files that the the backend's user owns (have
write access). If I try to make any changes on this code (eg.: the
casts...), when I try to use it the backends terminates abnormally.
Does someone can give me a clue?
pgsql-interfaces by date
|Next:||From: Ken Kachnowich||Date: 2000-10-16 23:37:04|
|Subject: Re: datetime fix|
|Previous:||From: Alfred Perlstein||Date: 2000-10-16 22:25:33|
|Subject: Re: What's going wrong?|