B4J Question Reading from custom file descriptor

wl

Well-Known Member
Licensed User
Longtime User
Hi,

I'm trying to write a checkpassword Java console app for Dovecot.

I found that in a bash script I should read data from file descriptor 3
(eg:
1
2
read-d$'\0'-r-u3USER
read-d$'\0'-r-u3PASS
)

I'm know on how to read from stdin (reader.Initialize (sys.getField('in")), but how to read from FD 3 ?

Thanks
 

wl

Well-Known Member
Licensed User
Longtime User
Ok, guess I found it ?

B4X:
reader.Initialize(File.OpenInput("/dev/fd/", "3"))
 
Upvote 0

wl

Well-Known Member
Licensed User
Longtime User
Thanks Erel, I was aware of this example but this reads from STDIN (FD 0 if I'm not wrong). I needed to read from FD 3
 
Upvote 0
Top