Recent

Author Topic: Api/component pack for Raspbian Linux, to use disk status.  (Read 1599 times)

pascalbythree

  • Sr. Member
  • ****
  • Posts: 266
Api/component pack for Raspbian Linux, to use disk status.
« on: November 27, 2024, 05:51:23 pm »
Can anybody please name a Lazarus disk manage component libary ?  I am working on my NAS project. And i am trying to find a appropriate class framework  to read all kinds of disk satus info to dsplay on my Character display on the front of my project.

Thank you, Greets Wouter van Wegen !

Dzandaa

  • Sr. Member
  • ****
  • Posts: 404
  • From C# to Lazarus
Re: Api/component pack for Raspbian Linux, to use disk status.
« Reply #1 on: November 27, 2024, 07:21:39 pm »
Hi,

Did you look in "Sysutils"? -> DiskSize, DiskFree

Didn't find the list of function in English.

Here in French: https://www.gladir.com/CODER/FREEPASCAL/sysutils.htm

If you need the S.M.A.R.T info, I don't know.

B->
Regards,
Dzandaa

pascalbythree

  • Sr. Member
  • ****
  • Posts: 266
Re: Api/component pack for Raspbian Linux, to use disk status.
« Reply #2 on: December 03, 2024, 01:14:51 pm »
Does not work sufficient

Does anybody have a better unit?

Thaddy

  • Hero Member
  • *****
  • Posts: 16393
  • Censorship about opinions does not belong here.
Re: Api/component pack for Raspbian Linux, to use disk status.
« Reply #3 on: December 03, 2024, 01:50:21 pm »
Code: Bash  [Select][+][-]
  1. #!/usr/bin/env bash
  2.  
  3. # Ensure sudo is authenticated at the beginning
  4. sudo -v || { echo "Error: You must provide sudo privileges to run this script."; exit 1; }
  5.  
  6. # Gather disk information
  7. {
  8.   echo "==================================================="
  9.   echo "-- PARTED DISK INFO --"
  10.   sudo parted -ls
  11.   echo "-- INXI DISK INFO --"
  12.   sudo inxi -DpRjlLoux
  13.   echo "-- LSBLK DISK INFO --"
  14.   sudo lsblk -fm
  15.   echo "==================================================="
  16. } > ~/diskinfo.txt 2>&1
  17.  
  18. echo "Disk information has been saved to ~/diskinfo.txt"
  19.  
and load diskinfo.txt in a memo? Needs sudo.
You can also use Tprocess to run parted, inxi and lsblk to gather the information.
You have to install inxi, but it is in the apt repository.
parted and lsblk do not need installation.

Of course you can also obtain all this information by using fpsystem and fpioctl calls but imho that is not worth it.
« Last Edit: December 03, 2024, 01:58:38 pm by Thaddy »
There is nothing wrong with being blunt. At a minimum it is also honest.

MarkMLl

  • Hero Member
  • *****
  • Posts: 8113
Re: Api/component pack for Raspbian Linux, to use disk status.
« Reply #4 on: December 03, 2024, 02:15:57 pm »
Does not work sufficient

What do you mean? Did you try it? What is "not sufficient"?

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

pascalbythree

  • Sr. Member
  • ****
  • Posts: 266
Re: Api/component pack for Raspbian Linux, to use disk status.
« Reply #5 on: December 05, 2024, 02:13:34 pm »
i mean is there a other disk size and disk free function/procedure without process executing?
it runs in a loop each second..

MarkMLl

  • Hero Member
  • *****
  • Posts: 8113
Re: Api/component pack for Raspbian Linux, to use disk status.
« Reply #6 on: December 05, 2024, 04:47:33 pm »
You've already been pointed at some procedures in SysUtils. Why are they inadequate for what you're trying to do?

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

pascalbythree

  • Sr. Member
  • ****
  • Posts: 266
Re: Api/component pack for Raspbian Linux, to use disk status.
« Reply #7 on: December 08, 2024, 03:24:50 pm »
Check this is my RPI MOD working as network attached storage.
As you can see there are 2 displays from 12x2 characters at the front.
You can also see my Raspberry 5 mounted in the enclosure.

simple: Does anybody have a name of a disk pack to finish of the ARM coding to my displays?

Without polling other process execution.

Or does it not exists?

Greets, Wouter

PS: It also comes with a HDMI cable to show full screen graphs of the utilization.

There is still 1 etch to go, seeing the space in the bottom left corner.

It would also be be neat to show the read and write rates MB/s on the display.

MarkMLl

  • Hero Member
  • *****
  • Posts: 8113
Re: Api/component pack for Raspbian Linux, to use disk status.
« Reply #8 on: December 08, 2024, 07:11:01 pm »
simple: Does anybody have a name of a disk pack to finish of the ARM coding to my displays?

What do you mean?

DEC RP04 was a disk pack... is that what you're asking?

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

pascalbythree

  • Sr. Member
  • ****
  • Posts: 266
Re: Api/component pack for Raspbian Linux, to use disk status.
« Reply #9 on: December 09, 2024, 10:07:30 am »
I mean a Lazarus component suite for disk handling.

MarkMLl

  • Hero Member
  • *****
  • Posts: 8113
Re: Api/component pack for Raspbian Linux, to use disk status.
« Reply #10 on: December 09, 2024, 10:47:34 am »
I mean a Lazarus component suite for disk handling.

You open files, write to them, and close them. Is that what you're asking?

Tell us accurately what you're looking for and somebody might be able to help. but we're not mind readers.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

cdbc

  • Hero Member
  • *****
  • Posts: 1781
    • http://www.cdbc.dk
Re: Api/component pack for Raspbian Linux, to use disk status.
« Reply #11 on: December 09, 2024, 11:43:17 am »
Hi
@pascalbythree: I think you're barking up the wrong tree... What would make you think, that someone would put low-level disk IO-operations from the kernel and RTL level, into a high-level framework like the /lazarus/ component framework?!?
The functions/procedures, structures, kernel-calls & signal-handlers are all there in FPC, for you to use as you see fit ...but alas, it entails work for *you* to make it all happen, *no-one* is giving you more than that!
If you feel like it and really need it, you'll figure it out ...and then /hopefully/ share your findings with the rest of us.
In short: Do it yourself!
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

 

TinyPortal © 2005-2018