> From: Norman Palardy <npalardy at great-white-software dot com>
> To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
>> Can RB read special unix files? Like /dev/random
>>
>> Did anyone ever have a need to do this?
>>
>> Just wondering...
>>
>> for what it's worth, you can read special unix files in RB
>> nowadays, using my ElfData plugin.
>
> Yes you can
> Charles documented it in Chapter 12 of his book some time ago
>
> However, a quick test using a folderitem in RB code does not seem to
> be able to get access to /dev/random or /dev/urandom
>
> dim f as folderItem
>
> f = GetFolderItem("/dev/urandom", FolderItem.PathTypeShell)
>
> if f is nil then
> msgbox "f is nil"
> return
> end if
>
> dim ts as TextInputStream = f.OpenAsTextFile
>
> dim s as string = ts.ReadLine
>
> break
dim f as ElfDataFile
f = "/dev/random"
msgbox f.Data(1024).Hex // reads in 1024 bytes and hexes them.
Well this works perfectly. Basically, ElfData reads special Unix files
just fine.
Also, I don't think reading /dev/random line by line makes much sense.
Because... it's a binary file. A line could be infinitely long :) if
you were infinitely unlucky enough.
--
http://elfdata.com/plugin/
"String processing, done right"
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|