RunProgram does not produce a result on MacOSX
Posted: Tue Dec 08, 2015 8:14 pm
I'm struggling with getting the result using the following code. In fact it seems to run forever and does not deliver any result at all.
Changing the parameter from "-Ramiscut" to "-rtl" will however produce a result quickly.
Perhaps anyone around here having an idea how to solve this problem?
Thanks,
Karl-Uwe
Code: Select all
pid = RunProgram("ls", "-Ramiscut", "/Users/me/Library/Caches/", #PB_Program_Open | #PB_Program_Wait | #PB_Program_Read)
If (pid)
Define.l BufferSize = AvailableProgramOutput(pid)
If (BufferSize > 0)
*Buffer = AllocateMemory(BufferSize)
ReadProgramData(pid, *Buffer, BufferSize)
Define.s result = PeekS(*Buffer, BufferSize)
UseMD5Fingerprint()
PrintN( StringFingerprint(result, #PB_Cipher_MD5) )
FreeMemory(*Buffer)
EndIf
CloseProgram(pid)
EndIf
Code: Select all
pid = RunProgram("ls", "-rtl", "/Users/me/Library/", #PB_Program_Open | #PB_Program_Wait | #PB_Program_Read)
Thanks,
Karl-Uwe