commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <>
Subject [jira] [Commented] (IO-269) Tailer locks file from deletion/rename on Windows
Date Wed, 05 Mar 2014 14:49:44 GMT


Sebb commented on IO-269:

bq. This is unnecessary and contributes to unnecessary file locking on Windows.

On the contrary, it is an essential part of unlocking the file on Windows when possible.
The full code is as follows:

if (reOpen) {
if (getRun() && reOpen) {
    reader = new RandomAccessFile(file, RAF_MODE);;

Notice that the file is closed - and therefore unlocked - during the sleep if reOpen is true.
If reOpen is false, the file remains locked by Windows for the duration of the Tailer thread.

> Tailer locks file from deletion/rename on Windows
> -------------------------------------------------
>                 Key: IO-269
>                 URL:
>             Project: Commons IO
>          Issue Type: Bug
>            Reporter: Sebb
>             Fix For: 2.4
>         Attachments: IO-269-v2.patch, IO-269-v3.patch, IO-269.patch,
> The Tailer code works on Windows, except that it locks the file against deletion or rename.
> The test code fails to detect this, because it fails to check if the file deletion succeeds.
> This seems to be a Windows OS issue.
> A possible solution might be to keep closing and re-opening the file.

This message was sent by Atlassian JIRA

View raw message