Recent

Author Topic: Mount() and Unmount() command  (Read 13836 times)

Fred vS

  • Hero Member
  • *****
  • Posts: 3831
    • StrumPract is the musicians best friend
Mount() and Unmount() command
« on: November 01, 2009, 07:14:06 pm »
Hello folks.
I dont have finded the command to mount a drive or unmount it.
In delphi it is mount('drive') and unmount('drive').

Is it a other way to mount a drive ?
Thanks

« Last Edit: November 01, 2009, 07:17:15 pm by fredvs »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1935
Re: Mount() and Unmount() command
« Reply #1 on: November 01, 2009, 08:18:35 pm »
There's mount and umount in unit "unixutils".
However I don't know if it runs everywhere, it seems to use libc.

Fred vS

  • Hero Member
  • *****
  • Posts: 3831
    • StrumPract is the musicians best friend
Re: Mount() and Unmount() command
« Reply #2 on: November 02, 2009, 05:14:19 pm »
Thanks Theo
It dont seem to work on my system.
I have try with a Tprocess and in commandline sudo -a mount but
it does not work after process.execute.
Any ideas ?
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Ocye

  • Hero Member
  • *****
  • Posts: 518
    • Scrabble3D
Re: Mount() and Unmount() command
« Reply #3 on: November 02, 2009, 05:25:01 pm »
...commandline sudo -a mount
If you want to mount all, the option "-a" should be given after the mount command. Is there any reason why a program should call "mount"? Do you know the automount feature?
Lazarus 1.7 (SVN) FPC 3.0.0

Blaazen

  • Hero Member
  • *****
  • Posts: 3241
  • POKE 54296,15
    • Eye-Candy Controls
Re: Mount() and Unmount() command
« Reply #4 on: November 02, 2009, 06:17:51 pm »
Hi,

try to look to sources of ACS components, where is also unit for working with cdrom (eject, close tray etc.).
Files: cd_rom.pas and cd_rom.inc
B.
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

Fred vS

  • Hero Member
  • *****
  • Posts: 3831
    • StrumPract is the musicians best friend
Re: Mount() and Unmount() command
« Reply #5 on: November 02, 2009, 06:19:45 pm »
Of course i use sudo mount -a and not sudo -a mount.

Is it possible to use -a (for all drives) with the mount() command of unixutils, or something else to mount all drives ?
Thanks
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 3831
    • StrumPract is the musicians best friend
Re: Mount() and Unmount() command
« Reply #6 on: November 02, 2009, 06:27:21 pm »
Re Hello folk,
I gonna explain what i want.
I have developped a dj mixing prog, you can download it there :
http://members.lycos.co.uk/mixk/
It creates also playlists of tunes, saves the name of file, dir and drive.
If i save a file from a mounted drive (for example NTFS), when i reload the prog without mount NTFS before load, the prog dont recognize NTFS.
Is it possible to Mount all drives in Form.create, so no more problems.

 %) sorry Ocye, i dont know about the automount feature, how can i use it in Lazarus ?

Thanks
 
« Last Edit: November 02, 2009, 06:34:48 pm by fredvs »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Ocye

  • Hero Member
  • *****
  • Posts: 518
    • Scrabble3D
Re: Mount() and Unmount() command
« Reply #7 on: November 02, 2009, 11:28:23 pm »
%) sorry Ocye, i dont know about the automount feature, how can i use it in Lazarus ?
If you insert a CD for instance it is mounted automatically, done by automount. More infos can be found with Google (automount fstab) or here http://www.faqs.org/docs/Linux-mini/Automount.html.
Lazarus 1.7 (SVN) FPC 3.0.0

Fred vS

  • Hero Member
  • *****
  • Posts: 3831
    • StrumPract is the musicians best friend
Re: Mount() and Unmount() command
« Reply #8 on: November 04, 2009, 05:01:15 pm »
Thanks Ocye but, because i want to developp a prog for all linux dist, i want to mount the driver with a fpc command.
How to mount a driver (when a drive is mounted you can find it in /media/) with a fpc command ?
Thanks
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 3831
    • StrumPract is the musicians best friend
Re: Mount() and Unmount() command
« Reply #9 on: November 06, 2009, 03:37:26 pm »
Toc,toc, toc, is there somebody ?  :(
Hem, can somebody help me with my problem of mount with a fpc command ?
I repeat, when you save the path of a mounted file, in Linux the name of drive is from /media.
If i want to mount back that driver, of course it does not exist in /media, how can i know with device  (in /dev) is the corespondent in /media, so i could mount it.

Many Thanks  ;)
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2674
Re: Mount() and Unmount() command
« Reply #10 on: November 06, 2009, 08:00:24 pm »
fpc doesn't seem to have a (u)mount function
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

Fred vS

  • Hero Member
  • *****
  • Posts: 3831
    • StrumPract is the musicians best friend
Re: Mount() and Unmount() command
« Reply #11 on: November 07, 2009, 03:42:17 pm »
Hello Marc.
There's mount() and umount() in unit "unixutils".
But when i will mount() a drive, i shoud mount(device).
An if the drive is mounted, with ExtractFileName(), it give you the name of the mounted device (not the device), directory and file.
Mounted device are in /media, device in /dev.
Then, if i want to load a file with the name saved with ExtractFileName(), and if the drive was not mounted before, it could not load (because not mounted, then not exists in /media).

I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2674
Re: Mount() and Unmount() command
« Reply #12 on: November 08, 2009, 06:09:20 pm »
ahh... it's based on libc and therefore nonexisting imo.
Anyway maybe you can use stat() to get the info
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

 

TinyPortal © 2005-2018