UTL_FILE.FOPEN ORA-20102: Invalid Operation

I want to use UTL_FILE.FOPEN('MY_DIR','test.txt','W');

but I get the following error :

ORA-20102: Invalid Operation

I tried to put READ and WRITE on 'MY_DIR' to public like this:

GRANT READ ON DIRECTORY MY_DIR to public

it changes nothing!

I gave all rights on MY_DIR (chmod 777 /test_data), the same result.

Thanks in advance.