SharpAdb / AdvancedSharpAdbClient

AdvancedSharpAdbClient is a .NET library that allows .NET, Mono and Unity applications to communicate with Android devices. It's improved version of SharpAdbClient.
https://sharpadb.github.io
Apache License 2.0
201 stars 54 forks source link

Is there a way of seeing if a FileStatisitcs result is a dir or file? #61

Closed prosthetichead closed 1 year ago

prosthetichead commented 1 year ago

I can't see an easy way of seeing this from the provided stats. Is there a way to see if a read statistics result is a file or directory?

I did have a idea of working it out by running everything through GetDirectoryListing and checking the result but wanted to check before I went down that path.

wherewhere commented 1 year ago

You can use ls command of Linux...

prosthetichead commented 1 year ago

@wherewhere Sorry how would I use the LS command of Linux when looking through the results returned by the GetDirectoryListing function?

wherewhere commented 1 year ago

ls your/path The path end with / is directory... Screenshot_20230625-133111.jpg

wherewhere commented 1 year ago

I was considered to create a file manager through Linux command. But it is too weird so I gave it up. Maybe you can reference it. https://github.com/yungd1plomat/AdvancedSharpAdbClient/blob/feature/filemanagement/AdvancedSharpAdbClient/FileManager/AdbFileSystem.cs

prosthetichead commented 1 year ago

How do I use the FileManager classes and AdbFileSystem, this looks like exactly what I'm looking for.

Some background of what I'm trying to use AdvancedSharpAdbClient for. The handheld console RG35xx uses ADB and I'm trying to write a little tool to interact with the file system on the device without taking out the SD card. I got it all connecting but I need a little more feature with interacting with files from the c# code.

prosthetichead commented 1 year ago

Oh ok looking through it more I think I understand why you keep saying use the LS command. Do you mean use method ExecuteRemoteCommand to execute LS on the device?

Edit: ExecuteRemoteCommand helps a lot thank you.

prosthetichead commented 1 year ago

I whipped up a little console display to send raw execute commands to the device and so far so good. This has helped a lot thankyou. image

wherewhere commented 1 year ago

That's it.