I am using a simple shell command.
Dim nShell as new shell
nShell.mode=1
nShell.Execute ("ls ~/desktop")
results=nShell.ReadAll // or nShell.result
no return Results
I have try with class as shell with data available and mode 1 and 2.
No results
When i switch to mode=0 then i get results
Is any restriction with commands in shell?
why do you need nShell.mode=1 ?
using mode 1
subclass Shell and use Event Handlers DataAvailable and Completed
Axel i have try with subclass Shell and use Event Handlers DataAvailable and Completed
No Result back
Sorry Axel is osx.
From what i see is when i use the mode 1,2 the data have delay my code is like this
Is better to use a thread and mode=0 ?
[code]Sub GFolder(fi as FolderItem)
Dim FolderName,FileShellPath As String
FileShellPath=fi.ShellPath
Dim results as string
nShell.Execute ("du -sh "+FileShellPath)
results=GetSize(nShell.ReadAll) //<<< Here i want the results the (getsize) is catching the size and return the data
Dim CellName As text
For i As Integer = 0 To Listbox1.ListCount-1
CellName = Listbox1.Cell(i, 0).ToText
If CellName = FolderName Then Exit
Next
If CellName <> FolderName Then
Listbox1.AddRow(fi.Name)
Listbox1.RowTag(Listbox1.LastIndex) = fi.ShellPath
Listbox1.Cell(Listbox1.LastIndex, 1) = fi.NativePath
Listbox1.Cell(Listbox1.LastIndex, 5) = fi.Length.ToText
End If
End Sub
[/code]
maybe you need to create a property nshell (Super = your Shell Sublass)
see this
Why not use the DataAvailable and Completed event ? In Mode 1, that is the normal way to proceed.
[quote=273571:@Axel Schneider]maybe you need to create a property nshell (Super = your Shell Sublass)
see this[/quote]
Well that was my mistake…Thank you Axel
Michel i think i need one more coffee !!