DELETE_ON_CLOSE question

Alan Bateman Alan.Bateman at Sun.COM
Thu Aug 6 08:11:49 PDT 2009


Christian Ullenboom wrote:
> If I change the Path to Paths.get( "c:/opa.herbert.tmp" ); then its
> fine. So the combination of Windows + Shared Folders + Samba seems to
> be the problem. Even if I put some sleep it doesn't delete the file.
>
> path.newOutputStream( StandardOpenOption.DELETE_ON_CLOSE,
> StandardOpenOption.SYNC ).close();
> TimeUnit.SECONDS.sleep( 10 );
> System.out.println( path.exists() );  // still true!
>
> So the file is still there but not if the Path is local, then its
> correctly deleted.
>
>  Christian
>   
Good sleuthing! Do you know what version of Samba you are using? I did a 
quick test with a number of different 2.x and 3.x Samba servers and 
could duplicate it on one of them (running 3.0.23). Looking through the 
Samba bugzilla I found 3467 [1] which looks like it might be the issue. 
I don't have a 3.0 server newer than 3.0.23 to check just now.

-Alan.

[1] https://bugzilla.samba.org/show_bug.cgi?id=3467



More information about the nio-discuss mailing list