[jcifs] Mailslot

Julien Menana Julien.MENANA at eleve.emn.fr
Wed May 12 20:00:46 GMT 2004


Hi,

I saw in the JCIFS Mailing List Archive that some people try to send 
data to a mailslot, but failed  and I can't find any answer.

With this code, I can write in a file which is shared :

----------------------------------------------------


import jcifs.smb.SmbNamedPipe;
import java.io.OutputStream;
import java.io.FileInputStream;

public class NetSend {
  
    public static void main ( String[] args ) throws Exception {

    
       
        String filename = "/home/bebui/bui.txt";
        FileInputStream fin = new FileInputStream ( filename );
      
        // provide 64kB
        byte[] b = new byte[65535];
  
       
        SmbNamedPipe pipe = new SmbNamedPipe(
        "smb://172.16.8.70/Incoming/testFile",
                SmbNamedPipe.PIPE_TYPE_WRONLY );
              
     
        OutputStream out = pipe.getNamedPipeOutputStream();
      
       
        int n = fin.read ( b );
      
       
        System.out.println( "write " + n + " bytes" );
      
       
        out.write ( b, 0, n);
      
        // Close the Handles
        out.close();     
        fin.close();
  
    }
}

-------------------------------------------------------

to write it to a mailslot i try to change thos lines :

  SmbNamedPipe pipe = new SmbNamedPipe(
        "smb://172.16.8.70/Incoming/testFile",
                SmbNamedPipe.PIPE_TYPE_WRONLY );

by

  SmbNamedPipe pipe = new SmbNamedPipe(
        "smb://172.16.8.70/IPC$/mailslot/messngr",
                SmbNamedPipe.PIPE_TYPE_WRONLY );


but I always have the following error :

Exception in thread "main" jcifs.smb.SmbException: File not found






So my question is : Can we Write data in a mailslot and if it is 
possible How ?

regards

Ju.


PS: Sorry for the english fault... hope it will be comprehensible.







More information about the jcifs mailing list