Hello All,

Description:
<replace> don't perform replacing in locked file a.xxx
but create temporary file a.xxx.temp and do replacing in it.

Details:
0. OS=W2K, Ant=1.4.1
1. I have file a.xxx.
2. I have some Ant target:
  <target name="test">
    <replace file="a.xxx" ... />
  </target>
3. Target works fine.

BUT!
If I open file a.xxx (in read-only mode) in MS Word
(or view it in FAR) so file become locked then
<replace> silently does its work (doesn't fail)
and produces file a.xxx.temp
but original file a.xxx stays unmodified.

Is it bug in <replace>?

PS. I experimented with <copy> and with <propertyfile> tasks
(in such a way that it should to modify locked file) and got
following faults:

* <copy>:
Failed to copy #src_file_name# to #locked_destination_file_name#
due to #locked_destination_file_name#
(The process cannot access the file because it is being used
by another process)

* <propertyfile>
java.io.FileNotFoundException: #locked_property_file_name# (The process
cannot access the file because it is being used by another process)

As for me it's more reasonable behaviour.

-- 
Best regards,
Eugene Voytitsky                          mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to