Existence of a file fails if it is created with SBC(C_N, W, D_ON_C) (Sol)

Alan Bateman Alan.Bateman at Sun.COM
Thu Sep 25 01:07:05 PDT 2008


Rajendra Gutupalli wrote:
> Hi Alan,
>
> When a SekableByteChannel is opened with option DELETE_ON_CLOSE, any 
> further attempt to check the existence of the file (and also deletion 
> of the file) fails in Solaris.
> In Windows it is not a problem. Please see the following code and 
> result in Solaris and Windows.
Yes, the difference is observable but the spec is clear that the details 
as to when and how the file is deleted are implementation specific (and 
therefore unspecified). The intended use-case is a work file that you 
want removed automatically when the channel/stream is closed or the VM 
terminates. Ideally, the file should not be visible in the file system 
on Windows after it is opened with this option but it has always been 
the case that files pending delete are visible until the last handle is 
closed.

-Alan.



More information about the nio-dev mailing list