<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>File is_open()</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Verdana">Hi,</FONT>
</P>
<P><FONT SIZE=2 FACE="Verdana">I'm doing some file processing and I want to prevent opening files while it is already opened.</FONT>
<BR><FONT SIZE=2 FACE="Verdana">I tried to open the files in write mode but it always succeed (I can open the file for writing many times)</FONT>
</P>
<P><FONT SIZE=2 FACE="Verdana">1> </FONT><A HREF="file:open("><U><FONT COLOR="#0000FF" SIZE=2 FACE="Verdana">file:open("file",[write])</FONT></U></A><FONT SIZE=2 FACE="Verdana">.</FONT>
<BR><FONT SIZE=2 FACE="Verdana">{ok, <0,35,0>}</FONT>
<BR><FONT SIZE=2 FACE="Verdana">2> </FONT><A HREF="file:open("><U><FONT COLOR="#0000FF" SIZE=2 FACE="Verdana">file:open("file",[write])</FONT></U></A><FONT SIZE=2 FACE="Verdana">.</FONT>
<BR><FONT SIZE=2 FACE="Verdana">{ok, <0,37,0>}</FONT>
</P>
<P><FONT SIZE=2 FACE="Verdana">I tried to rename the file after opening and it also succeeds, although the documentation says "</FONT><FONT FACE="Times New Roman">Renaming of open files is not allowed on most platforms</FONT><FONT SIZE=2 FACE="Verdana">"</FONT></P>
<P><FONT SIZE=2 FACE="Verdana">3> </FONT><A HREF="file:open("><U><FONT COLOR="#0000FF" SIZE=2 FACE="Verdana">file:open("file",[read])</FONT></U></A><FONT SIZE=2 FACE="Verdana">.</FONT>
<BR><FONT SIZE=2 FACE="Verdana">{ok, <0,35,0>}</FONT>
<BR><FONT SIZE=2 FACE="Verdana">4> </FONT><A HREF="file:rename("><U><FONT COLOR="#0000FF" SIZE=2 FACE="Verdana">file:rename("file","file2")</FONT></U></A><FONT SIZE=2 FACE="Verdana">.</FONT>
<BR><FONT SIZE=2 FACE="Verdana">ok</FONT>
</P>
<P><FONT SIZE=2 FACE="Verdana">Any clues ?</FONT>
</P>
<BR>
<P><FONT SIZE=2 FACE="Verdana">Thanks</FONT>
</P>
<P><FONT SIZE=2 FACE="Verdana">Regards,<B><I></I></B></FONT>
<BR><B><I><FONT COLOR="#000080" SIZE=2 FACE="Verdana">Ali Yakout</FONT></I></B>
</P>
</BODY>
</HTML>