Page 1 of 1

Linux get drive liste...

Posted: Thu May 28, 2009 9:12 pm
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.

Posted: Thu May 28, 2009 9:30 pm
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".

Posted: Thu May 28, 2009 9:37 pm
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

Posted: Fri May 29, 2009 5:09 am
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.

Posted: Fri May 29, 2009 11:57 am
by gally
Thank you, Media is the good directory then my question and how the list of media directory on linux.

thank you again

Posted: Fri May 29, 2009 2:02 pm
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

Posted: Fri May 29, 2009 4:59 pm
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