[jcifs] RE: jCIFS corrupt files

Michael B Allen mba2000 at ioplex.com
Thu Oct 2 18:53:52 EST 2003

> The reason I haven't suspected the servers

Yeah, it's not the servers.

I don't know what the problem is. Somehow the file offset pointer
(SmbFileOutputStream.fp) is getting messed up. What bothers me is that
once the problem happens it persists. I don't see what could happen that
could mess up the file pointers of a all files in a persistent way. That's
just bazaar. You're running an unmodified distribution right?

I have placed a new jar in the download area that just has a debugging
Log.println statement in SmbFileOutputStream.write(). Otherwise it is
stock 0.7.13. Please put something like the following somewhere in your

import jcifs.util.Log;
PrintWriter out = new BufferedPrintWriter( new FileOutputStream(
"/tmp/log.txt" ));
Log.setPrintWriter( out );
Log.setMask( Log.EXCEPTIONS | Log.DEBUGGING );
out.close(); // or shutdown to flush stream maybe

Run your app and provoke it to generate corrupted files. If log.txt is
under 1M send me the whole file. Otherwise send me the tail end of writes
that are generating corrupted files and the area around where 'fp'
suddenly changes.


A program should be written to  model the concepts of the task it
performs rather than the physical world or a process because this
maximizes the  potential for it  to be applied  to tasks that are
conceptually similar and, more  important, to tasks that have not
yet been conceived.

More information about the jcifs mailing list