Received: from mailer.nupes.cefetpr.br (nat-nupes.cpdtt.cefetpr.br [200.134.9.250]) by hub.org (8.10.1/8.11.0) with ESMTP id e9GMBpW45127 for ; Mon, 16 Oct 2000 18:11:52 -0400 (EDT) (envelope-from igor@nupes.cefetpr.br) Received: from nupes.cefetpr.br (igor@biot [172.16.4.43]) by mailer.nupes.cefetpr.br (8.8.7/8.8.8) with ESMTP id UAA21104 for ; Mon, 16 Oct 2000 20:10:57 -0200 (EDT) Message-ID: <39EB8A6B.E1EB3E44@nupes.cefetpr.br> Date: Mon, 16 Oct 2000 21:08:27 -0200 From: Igor Gavriloff Organization: NuPES X-Mailer: Mozilla 4.72 [pt_BR] (X11; U; Linux 2.2.14-14cl i686) X-Accept-Language: pt-BR, en MIME-Version: 1.0 To: "pgsql-interfaces@postgresql.org" Subject: What's going wrong? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200010/135 X-Sequence-Number: 1492 Hi, 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): #include #include 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' LANGUAGE 'c'; 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? Thanks, Igor.