remove named pipes

Hi,

Please help me on this.
I am creating a named pipe in a kshell script.
I am using mkfifo pipe_name command to create the pipe.

I want to remove the named pipe after my work is completed.

How can i do that.

rm pipe_name

Hi Thanks for your reply , I have used that but , the next time when i am executing the script i am getting an exception like

"mkfifo: cannot create pipe_name: File exists"

Does your previous process still keep it open? Does the remove fail?

Yes, that could well be the case.
So he better should issue an fuser on his named pipe to check if some process
is reading from or writing to it before applying the rm.

Or simply generate a unique file name for the FIFO each time the script is run.

I didn't get any exceptions while issuing the rm command on the named_pipe. So I think the pipe is already removed successfully.

The following is the code that i am using. please help.

if [ -f ${home}/transfer/sample.csv.Z ]
then
mkfifo -p load_pipe.fifo &
zcat ${home}/transfer/sample.csv.Z > load_pipe.fifo
else
echo "${home}/transfer/sample.csv.Zdoesn't exist"
exit ${SEVERE_ERROR};
fi;

rm load_pipe.fifo

Hi Guys,

I have changed the name of the named pipe alone and it is working fine now.

Thanks a lot for all the help.