Vassilis K ha scritto:
> Some months ago Doriano suggested the code for the printing of 1 line on
> a parallel printer which is the following:
>
> PUBLIC SUB bEktiposi_Click()
>         DIM hPrinter AS File
>         hPrinter = OPEN "/dev/lp0" FOR OUTPUT
>         hPrinter.EndOfLine = gb.Windows
>         PRINT #hPrinter, "test a line: "
>         CLOSE hPrinter
> END
> (I had to add the lp group to the user vassilis)
>
> I'm looking for the code for the printing of the same line from a PC in the 
> local network.
> I've tried:
>
> PUBLIC SUB bEktiposi_Click()
>         DIM hPrinter AS File
>         hPrinter = OPEN "vassi...@192.168.1.10/dev/lp0" FOR OUTPUT
>         hPrinter.EndOfLine = gb.Windows
>         PRINT #hPrinter, "test a line: "
>         CLOSE hPrinter
> END
>
> But it says: "Access forbiden"
>
> I've made the printer shared and given to the /dev/lp0 file read - write 
> permissions (for user-group and other)
>   
I don't think that this is possible, in that way. What you are doing now 
is to try to create a file named "lp0" in a directory "dev" in a 
directory "vassi...@192.168.1.10" in the current directory. A similar 
form (I mean, using file access) could work (I am not sure) by mounting 
the remote files - usually one mounts whole directories. Using either 
Samba or Nfs you should mount the /dev directory of the computer 
192...10 into a local directory, say /mnt/10dev. Then you could try to 
use the file "/mnt/10dev/lp0". I've never seen this method in real 
world, but it could work.

Another way, more common, is to use the traditional print sharing 
mechanisms of unix, lp: on the .10 machine you set up a print server, 
and on the local machine you configure a network printer referring to 
the .10 machine. The same can be done with CUPS. However, in both ways, 
printing is done in a totally different manner, which can be a problem 
for you; both mechanisms work on "documents", not single lines of text: 
it is probably difficult to convince the print manager that you don't 
want a form feed at the end of the printing.

Regards,

-- 
Doriano Blengino

"Listen twice before you speak.
This is why we have two ears, but only one mouth."


------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to