[jcifs] Can I trim a smb file?

Michael B Allen mba2000 at ioplex.com
Wed Jul 30 12:23:36 EST 2003


> Can I trim a smb file from 512k to 64k?

No. The way to truncate a file in Java is to use
RandomAccessFile.setLength(). Someone posted an SmbRandomAccessFile
implementation once but it was never incorporated into the distribution.

[Personal note for future reference; To implement setLength() it will also
be necessary to implement SMB_COM_WRITE and to which a lenth of 0 and an
offset of the provided setLength() parameter can be specified.]

Mike




More information about the jcifs mailing list