View other drives

Post

Posted
Rating:
#1 (In Topic #1440)
Avatar
Guru
cogier is in the usergroup ‘Guru’
cogier is in the usergroup ‘GambOS Contributor’
 I want to look at the files on my phone, but I can't see how to view any other drives but the main one. Am I missing something?
Online now: No Back to the top

Post

Posted
Rating:
#2
Banned
 What with ?

FileChooser.class ?

Did you set FileChooser.Root to "/" or to a folder?

If .Root property is / you should be able to see everything the system can.

If .Root property is set to a folder you can only see from that folder.

Maybe it's that?
Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Guru
cogier is in the usergroup ‘Guru’
cogier is in the usergroup ‘GambOS Contributor’
Good point, I had not thought of that, but it still doesn't work for me.

<IMG src="https://www.cogier.com/gambas/FileChooserRoot.png"> </IMG>
Online now: No Back to the top

Post

Posted
Rating:
#4
Banned
is it in the media folder?

Code (gambas)

  1.  
  2. Dim sPath As String = "/run/media" &/ User.Name  ' Os's like Fedora use /run/media
  3. If Not Exist(sPath) Then sPath = "/media" &/ User.Name  ' others use /media
  4.  
  5. FileChooser1.Root = sPath
  6.  
  7.  
Online now: No Back to the top

Post

Posted
Rating:
#5
Avatar
Expert
Quincunxian is in the usergroup ‘Expert’
Quincunxian is in the usergroup ‘Blogger’
 I'm on Mint so may be different but:
/dev/disk/by-label
gets me all the installed disks I have with their label apart from the primary drive.

Cheers - Quin.
I code therefore I am
Online now: No Back to the top

Post

Posted
Rating:
#6
Avatar
Guru
cogier is in the usergroup ‘Guru’
cogier is in the usergroup ‘GambOS Contributor’
Thanks guys but no joy. I can't find the directories "/run/media" or "/dev/disk/by-label" and "/media" &/ "User.Name" is empty. I am using Mint 22 and I think the files are in "/dev/disk/by-id", see list below (my phone is not listed!), but I can't read them and, looking at the file names, there seems to be a lot of duplication. I've done some searching, but I am unable to find a command that will give me a simple list of devices with their names. Then, how to access a drive? I didn't think it was going to be this complicated. :cry:

/dev/disk/by-id/ata-Hitachi_HDT721010SLA360_STF607MS1R9MEK
/dev/disk/by-id/ata-Hitachi_HDT721010SLA360_STF607MS1R9MEK-part1
/dev/disk/by-id/ata-Hitachi_HDT721010SLA360_STF607MS1R9MEK-part2
/dev/disk/by-id/ata-Hitachi_HDT721010SLA360_STF607MS1R9MEK-part3
/dev/disk/by-id/ata-Samsung_SSD_860_EVO_500GB_S4XBNZFN401278Y
/dev/disk/by-id/ata-Samsung_SSD_860_EVO_500GB_S4XBNZFN401278Y-part1
/dev/disk/by-id/ata-V_Series_SATA_SSD_120GB_224710893500357
/dev/disk/by-id/ata-V_Series_SATA_SSD_120GB_224710893500357-part1
/dev/disk/by-id/nvme-eui.e8238fa6bf530001001b444a4959842d
/dev/disk/by-id/nvme-eui.e8238fa6bf530001001b444a4959842d-part1
/dev/disk/by-id/nvme-WD_Blue_SN570_250GB_21353V640713
/dev/disk/by-id/nvme-WD_Blue_SN570_250GB_21353V640713_1
/dev/disk/by-id/nvme-WD_Blue_SN570_250GB_21353V640713_1-part1
/dev/disk/by-id/nvme-WD_Blue_SN570_250GB_21353V640713-part1
/dev/disk/by-id/usb-USB2.0_External_Mass_Storage_Device_0010101640100D695
/dev/disk/by-id/wwn-0x5000cca35ed83bce
/dev/disk/by-id/wwn-0x5000cca35ed83bce-part1
/dev/disk/by-id/wwn-0x5000cca35ed83bce-part2
/dev/disk/by-id/wwn-0x5000cca35ed83bce-part3
/dev/disk/by-id/wwn-0x5002538ed04ec5f5
/dev/disk/by-id/wwn-0x5002538ed04ec5f5-part1
/dev/disk/by-id/wwn-0x5000000000000000
/dev/disk/by-id/wwn-0x5000000000000000-part1
Online now: No Back to the top

Post

Posted
Rating:
#7
Banned
 Hmm, does your code have "User.Name" (with quotes) like your example or just User.Name

cause I'm using mint and it has always used "/media" &/ User.Name

FileChooser1.Root = "/media" &/ User.Name

what does your file browser show is in /media/ ?
Online now: No Back to the top

Post

Posted
Rating:
#8
Banned
 lsblk -o "MOUNTPOINT"| grep /

should list all mounted disks
Online now: No Back to the top

Post

Posted
Rating:
#9
Avatar
Guru
cogier is in the usergroup ‘Guru’
cogier is in the usergroup ‘GambOS Contributor’
Hmm, does your code have "User.Name" (with quotes) like your example or just User.Name
Opps. This was a typing mistake when writing the post, the code was correct.

cause I'm using mint and it has always used "/media" &/ User.Name
I have looked at this on 2 computers, just to make sure, both running Mint 22 and this is what shows, including hidden files.

<IMG src="https://www.cogier.com/gambas/NoFiles.png"> </IMG>

what does your file browser show is in /media/ ?

<IMG src="https://www.cogier.com/gambas/MediaFiles.png"> </IMG>

lsblk -o "MOUNTPOINT"| grep /

should list all mounted disks

<IMG src="https://www.cogier.com/gambas/lsblkMountpoint.png"> </IMG>

The file browser, Nemo, shows my phone's Music folder as "mtp://HMD_Global_Nokia_X30_5G_H1X9FI1AL03B0800099/Internal shared storage/Music/" (With or without %20s for spaces) but Gambas does not want to Dir() that folder either.

<IMG src="https://www.cogier.com/gambas/MusicFolder.png"> </IMG>
Online now: No Back to the top

Post

Posted
Rating:
#10
Banned
eew , that's wierd..

maybe like this…
<HIGHLIGHT highlight="shell">
$ ls /run/user/1000/gvfs/
'mtp:host=Google_Pixel_8a_43221JEKB18852'

$ ls "/run/user/1000/gvfs/mtp:host=Google_Pixel_8a_43221JEKB18852"/
'Internal shared storage'

$ ls "/run/user/1000/gvfs/mtp:host=Google_Pixel_8a_43221JEKB18852/Internal shared storage"/
 Alarms    Audiobooks   Documents   Movies  'Music (1)'    Notifications   Podcasts     Ringtones
 Android   DCIM         Download    Music    Pictures        Recordings
</HIGHLIGHT>
Online now: No Back to the top

Post

Posted
Rating:
#11
Avatar
Guru
cogier is in the usergroup ‘Guru’
cogier is in the usergroup ‘GambOS Contributor’
Excellent. That did it! I wrote the following code in Gambas and it worked. Thanks, Bruce.

Code (gambas)

  1. Public Sub Form_Open()
  2.  
  3. 'Dim sFiles As String[] = Dir("/run/user/1000/gvfs/mtp:host=Google_Pixel_8a_43221JEKB18852/Internal shared storage")
  4. Dim sFiles As String[] = Dir("/run/user/1000/gvfs/mtp:host=HMD_Global_Nokia_X30_5G_H1X9FI1AL03B0800099/Internal shared storage/Music/")
  5.  
  6. For iLoop As Integer = 0 To sFiles.Max
  7.     TextArea1.Text &= Format(iLoop + 1, "000") & "/. " & sFiles[iLoop]
  8.     If iLoop <> sFiles.max Then TextArea1.Text &= gb.NewLine
  9.  
  10.  
Online now: No Back to the top
1 guest and 0 members have just viewed this.