Linux get drive liste...

Linux specific forum
User avatar
gally
User
User
Posts: 41
Joined: Thu May 28, 2009 9:07 pm
Location: France
Contact:

Linux get drive liste...

Post by gally »

Hello everyone,

Sorry in advance for my bad english I translated by Google.

I am looking to have the list of drive on linux and whether this is a key or not.

I am on windows but I can not find on Linux. I exported my research application tomtomax maxibox on Windows and Linux.

Thank you in advance to all
GallyHC

PS: For the admin, GallyHC account obviously wrong but I put my email.
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

I'm not sure if this answers your request but if you're looking to list the drives available on Linux you use "fdisk -l".
User avatar
gally
User
User
Posts: 41
Joined: Thu May 28, 2009 9:07 pm
Location: France
Contact:

Post by gally »

Thank you, my request is code for PureBasic. I look for the device to locate a tomtom or not. From the application I am updating the Tomtom.

Best regards
GBeebe
Enthusiast
Enthusiast
Posts: 263
Joined: Sat Oct 09, 2004 6:52 pm
Location: Franklin, PA - USA
Contact:

Post by GBeebe »

Linux doesn't use "Drives" like Windows does.
Check your /mnt or /media folder for a INTERNAL folder. If it's there then your TomTom is plugged in and the INTERNAL directory IS the path to the TomTom "drive" itself.

On my PC it's /media/INTERNAL This directory only exists when my TomTom is plugged in. If I delete the /media/INTERNAL/art folder I actually delete the art folder in the TomTom. Hope this helps.
User avatar
gally
User
User
Posts: 41
Joined: Thu May 28, 2009 9:07 pm
Location: France
Contact:

Post by gally »

Thank you, Media is the good directory then my question and how the list of media directory on linux.

thank you again
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4792
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Post by Fangbeast »

gally wrote:Thank you, Media is the good directory then my question and how the list of media directory on linux.

thank you again
Why not ls /mnt or ls /MEDIA and pipe the results to your purebasic program?

ls /mnt | myprogramname
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
User avatar
gally
User
User
Posts: 41
Joined: Thu May 28, 2009 9:07 pm
Location: France
Contact:

Post by gally »

Thank you to everyone with the help, I found a solution I will give fair or event.

Code: Select all

Procedure getTomtomDrive()
;
  Define filename.s
  Define filereps.s
  If ExamineDirectory(0, "/media/", "*.*")
    While NextDirectoryEntry(0)
      filename = DirectoryEntryName(0)
      If DirectoryEntryType(0) = #PB_DirectoryEntry_Directory
        If FileSize("/media/"+filename+"/........") <> -1
          filereps = "/media/"+filename+"/"
        EndIf
      EndIf
    Wend
  EndIf
  MessageRequester("MAXI-BOX Pro", filereps, #PB_MessageRequester_Ok)

EndProcedure
........ is a find file ;) For you is good or not?

just thank (vraiment un grand merci a tous)
GallyHC
Post Reply