[jcifs] Problems with SmbOutputFileStream.write() to a NetWare-Server

Rudi Synoradzki RSynoradzki at gmx.net
Wed Dec 3 14:25:27 GMT 2003


I am running jCifs against a NetWare 6 SP3 Server running NFAP/CIFS. I get an 
error [ERRSRV/64] when trying to write into a file on a CIFS-Share on my 
server, although the file is being created (with 0 bytes). 

What I've tested:

file=new SmbFileOutputStream...
file.close(); 
does not return an error

file=new SmbFileOutputStream...
file.write(...);
does return an error

So definitively the write fails. Creation and closing the file works. When 
using smbFile.exist() or smbFile.canWrite() against the file after it was 
created by SmbOutputFileStream(), I get "true" also.

The code I use:

// wFile contains the url (without smb:)
// wValue is a string to write into wFile

// To access the file when using a SmbFile-
// Object for definition of SmbOutputFileStream
 try {
       share = new SmbFile("smb:"+wFile);
 } catch (IOException e0) {
        return (e0.getMessage()); 
 }
		
// To write into the file,  both definitions for
// the SmbFileOutputStream fail with SRVERR/64
 try {

      // using URL:
       file = new SmbFileOutputStream("smb:"+wFile);
      // using SmbFile: 
      // file = new SmbFileOutputStream(share);

       file.write(wValue.getBytes()); // Will get no error if commented out

 } catch (Exception e1) {
	return (e1.getMessage()); // Which is SRVERR/64 after the write
 }

// Then close the file
 try {
       file.close();
 } catch (Exception e2) {
	return (e2.getMessage());
 }

I'd be happy, if someone could help me
regards
Rudi



More information about the jcifs mailing list