[fpc-pascal] Low level disc access under windows with FPC
Pianoman
pianoman at centrum.sk
Sun Oct 8 14:08:53 CEST 2006
Hello, I'd like to ask if someone has experiences with low level
disk operations in windows with FPC.
The program should be able to copy entire diskete to one single image file
and for example extract a single file from that image or view its contents.
For example how can I read one sector from disk in to buffer?
Thanx for help
Pianoman
----- Original Message -----
From: <fpc-pascal-request at lists.freepascal.org>
To: <fpc-pascal at lists.freepascal.org>
Sent: Saturday, October 07, 2006 5:08 AM
Subject: fpc-pascal Digest, Vol 26, Issue 18
> Send fpc-pascal mailing list submissions to
> fpc-pascal at lists.freepascal.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
> or, via email, send a message with subject or body 'help' to
> fpc-pascal-request at lists.freepascal.org
>
> You can reach the person managing the list at
> fpc-pascal-owner at lists.freepascal.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of fpc-pascal digest..."
>
>
> Today's Topics:
>
> 1. Re: RE: Get Local IP using glib (eth0,eth1) (Graeme Geldenhuys)
> 2. Re: RE: Get Local IP using glib (eth0,eth1) (Marco van de Voort)
> 3. Re: Unistalling FPC (and reinstalling from svn) (Jochem Berndsen)
> 4. Re: RE: Get Local IP using glib (eth0,eth1) (TOUZEAU DAVID)
> 5. visualserver from VisualSynapse how implement it as a Linux
> console Daemon (TOUZEAU DAVID)
> 6. THREADVARLIST_FVCOMMON & THREADVARLIST_MEMORY undefined
> symbols while linking (Ken G. Brown)
> 7. Re: RE: h2pas error report (Marc Santhoff)
> 8. Install freepascal Mysql package to kylix 3
> (suryono_03 at kharisma.ac.id)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 6 Oct 2006 16:27:58 +0200
> From: "Graeme Geldenhuys" <graemeg.lists at gmail.com>
> Subject: Re: [fpc-pascal] RE: Get Local IP using glib (eth0,eth1)
> To: "FPC-Pascal users discussions" <fpc-pascal at lists.freepascal.org>
> Message-ID:
> <cfcebe780610060727m38fca3a2p2f9bc5f4c26bdd1e at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> I have these two functions in my .bashrc file. You only need to run
> "ii" for the cool output. Now back to the question - If it is for
> linux only, why not just use the /sbin/ifconfig output. After all, it
> is accurate and seem much easier than all those libc/library methods.
> I pull the IPs and Interfaces available from the /sbin/ifconfig output
> and works just fine. If it was needed on windows, I am sure you could
> to the same thing with the 'ipconfig' output.
>
> My 2c worth! :-)
>
>
> Regards,
> - Graeme -
>
>
>
> ------------ .bashrc ---------------------
> function my_ip() # get IP adresses
> {
> MY_IP=$(/sbin/ifconfig eth0 | awk '/inet/ { print $2 } ' | sed -e
> s/addr://)
> MY_ISP=$(/sbin/ifconfig ppp0 | awk '/P-t-P/ { print $3 } ' | sed
> -e s/P-t-P://)
> }
>
> function ii() # get current host related info
> {
> echo -e "\nYou are logged on ${RED}$HOST"
> echo -e "\nAdditionnal information:$NC " ; uname -a
> echo -e "\n${RED}Users logged on:$NC " ; w -h
> echo -e "\n${RED}Current date :$NC " ; date
> echo -e "\n${RED}Machine stats :$NC " ; uptime
> echo -e "\n${RED}Memory stats :$NC " ; free
> my_ip 2>&- ;
> echo -e "\n${RED}Local IP Address :$NC" ; echo ${MY_IP:-"Not
> connected"}
> echo -e "\n${RED}ISP Address :$NC" ; echo ${MY_ISP:-"Not connected"}
> echo
> }
> ---------------------------------
>
> On 06/10/06, Jeff Pohlmeyer <yetanothergeek at gmail.com> wrote:
>> > Better, but still Linux only. For a good solution,
>> > a resolver unit that accesses libc should be
>> > written that is portable (unlike the libc unit)
>>
>>
>> If I understood correctly, the OP had two questions:
>>
>> 1. Retrieve a list of interface names on a *linux* system.
>> 2. Return the IP address for a given *linux* interface name.
>>
>>
>> And the only "good" solution is a portable resolver unit?
>>
>> How will you resolve "eth0" on Win32 or BSD ?
>>
>> -Jeff
>
>
> --
> There's no place like 127.0.0.1
>
>
> ------------------------------
>
> Message: 2
> Date: Fri, 6 Oct 2006 16:33:35 +0200 (CEST)
> From: marcov at stack.nl (Marco van de Voort)
> Subject: Re: [fpc-pascal] RE: Get Local IP using glib (eth0,eth1)
> To: FPC-Pascal users discussions <fpc-pascal at lists.freepascal.org>
> Message-ID: <20061006143335.736F92288E at snail.stack.nl>
> Content-Type: text/plain; charset="US-ASCII"
>
>> > Better, but still Linux only. For a good solution,
>> > a resolver unit that accesses libc should be
>> > written that is portable (unlike the libc unit)
>>
>> If I understood correctly, the OP had two questions:
>>
>> 1. Retrieve a list of interface names on a *linux* system.
>> 2. Return the IP address for a given *linux* interface name.
>
> I don't understand that last one. _WHY_ would you want to enumerate and
> then
> still use hardcoded "eth0" What if eth0 is my internal and eth1 my
> external
> interface? The only meaning of the name is order of detection.
>
>> And the only "good" solution is a portable resolver unit?
>>
>> How will you resolve "eth0" on Win32 or BSD ?
>
> Usually you enumerate the interfaces list, till you find the interface
> with
> the "default" (ANY) route, so you have the default gateway, regardless of
> name. That is usually the interface you interested in.
>
> IOW names say nothing, routes and masks do.
>
>
> ------------------------------
>
> Message: 3
> Date: Fri, 6 Oct 2006 10:54:50 +0200
> From: Jochem Berndsen <j.f.berndsen at student.tue.nl>
> Subject: Re: [fpc-pascal] Unistalling FPC (and reinstalling from svn)
> To: FPC-Pascal users discussions <fpc-pascal at lists.freepascal.org>
> Message-ID: <200610061054.52878.j.f.berndsen at student.tue.nl>
> Content-Type: text/plain; charset="iso-8859-1"
>
> On Friday 06 October 2006 10:49, Adrian Maier wrote:
>> I have a silly question : which is the best way to uninstall FPC ?
> I don't know.
>
>> Also, after compiling FPC with 'make build' , if i execute 'make
>> install' will it
>> copy everyting in /usr/local by default ? Is the destination
>> directory configurable
>> somehow?
> Yes. You can choose the installation directory using
> make install INSTALL_PREFIX=/path/to/install
> (For example,
> make install INSTALL_PREFIX=/usr/local
> This will create bin/ and lib/ and other directories if they do not exist
> already.)
>
> Jochem.
>
>
> ------------------------------
>
> Message: 4
> Date: Fri, 06 Oct 2006 17:53:33 +0200
> From: TOUZEAU DAVID <david.touzeau at fr.kaspersky.com>
> Subject: Re: [fpc-pascal] RE: Get Local IP using glib (eth0,eth1)
> To: FPC-Pascal users discussions <fpc-pascal at lists.freepascal.org>
> Message-ID: <45267BFD.5030107 at fr.kaspersky.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Many thanks to the community
>
> To reply to Graeme :
> why not just use the /sbin/ifconfig output ?
> Simply to be more dev compliance... using an external program is slower
> and sometime ifconfig doesn't exist or is deleted on target computers.
>
> To reply to Marco :
> And the only "good" solution is a portable resolver unit?
> How will you resolve "eth0" on Win32 or BSD ?
>
> For WIN32, i d'ont care because the program is only for Linux systems.
> Your are true, in BSD the network interface is not the same and i must
> detect wich interface is used...
>
> Best regards
>
>
>
>
>
>
> Graeme Geldenhuys a écrit :
>> I have these two functions in my .bashrc file. You only need to run
>> "ii" for the cool output. Now back to the question - If it is for
>> linux only, why not just use the /sbin/ifconfig output. After all, it
>> is accurate and seem much easier than all those libc/library methods.
>> I pull the IPs and Interfaces available from the /sbin/ifconfig output
>> and works just fine. If it was needed on windows, I am sure you could
>> to the same thing with the 'ipconfig' output.
>>
>> My 2c worth! :-)
>>
>>
>> Regards,
>> - Graeme -
>>
>>
>>
>> ------------ .bashrc ---------------------
>> function my_ip() # get IP adresses
>> {
>> MY_IP=$(/sbin/ifconfig eth0 | awk '/inet/ { print $2 } ' | sed -e
>> s/addr://)
>> MY_ISP=$(/sbin/ifconfig ppp0 | awk '/P-t-P/ { print $3 } ' | sed
>> -e s/P-t-P://)
>> }
>>
>> function ii() # get current host related info
>> {
>> echo -e "\nYou are logged on ${RED}$HOST"
>> echo -e "\nAdditionnal information:$NC " ; uname -a
>> echo -e "\n${RED}Users logged on:$NC " ; w -h
>> echo -e "\n${RED}Current date :$NC " ; date
>> echo -e "\n${RED}Machine stats :$NC " ; uptime
>> echo -e "\n${RED}Memory stats :$NC " ; free
>> my_ip 2>&- ;
>> echo -e "\n${RED}Local IP Address :$NC" ; echo ${MY_IP:-"Not
>> connected"}
>> echo -e "\n${RED}ISP Address :$NC" ; echo ${MY_ISP:-"Not connected"}
>> echo
>> }
>> ---------------------------------
>>
>> On 06/10/06, Jeff Pohlmeyer <yetanothergeek at gmail.com> wrote:
>>> > Better, but still Linux only. For a good solution,
>>> > a resolver unit that accesses libc should be
>>> > written that is portable (unlike the libc unit)
>>>
>>>
>>> If I understood correctly, the OP had two questions:
>>>
>>> 1. Retrieve a list of interface names on a *linux* system.
>>> 2. Return the IP address for a given *linux* interface name.
>>>
>>>
>>> And the only "good" solution is a portable resolver unit?
>>>
>>> How will you resolve "eth0" on Win32 or BSD ?
>>>
>>> -Jeff
>>
>>
>
> --
>
> David Touzeau -------------------------- Linux Ubuntu Dapper 6.0.6
> FreePascal-Lazarus,perl,delphi,php icq:160018849
>
>
>
> ------------------------------
>
> Message: 5
> Date: Fri, 06 Oct 2006 18:02:25 +0200
> From: TOUZEAU DAVID <david.touzeau at fr.kaspersky.com>
> Subject: [fpc-pascal] visualserver from VisualSynapse how implement it
> as a Linux console Daemon
> To: FPC-Pascal users discussions <fpc-pascal at lists.freepascal.org>
> Message-ID: <45267E11.1060801 at fr.kaspersky.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Dear
>
> is anybody there use visualserver from VisualSynapse
> (http://visualsynapse.sourceforge.net/?id=8) and impleted it on Linux
> has a console mode...??
> Examples given is only on application interface ...
>
> Problems:
>
> 1) When the application start, no web page are generated...
> 2) i would like to develop a variant of this web server. In this case, i
> need to trap the requests received by the process.
>
> Here it is a sample that didn't working
>
> //*************************************************************************************************
> program shttpserver;
>
> {$mode objfpc}{$H+}
>
> uses
> //ArticaAgent
> cthreads,custapp, Classes, SysUtils, fpcunit,httpserver ;
>
> const
> Version = 'Version 0.1';
>
> type
> TTestRunner = class(TCustomApplication)
> private
>
>
> protected
> procedure DoRun; override;
> public
> procedure Listen(receive:string);
> end;
>
> procedure TTestRunner.DoRun;
> var
> I: integer;
> S: string;
> begin
> // writeln('create...');
> end;
>
> procedure TTestRunner.Listen(receive:string);
> begin
> // writeln('string received: ' + receive);
> end;
>
> var
> App: TTestRunner;
> eHTTP : TvsHTTPServer;
> begin
> App := TTestRunner.Create(nil);
> eHTTP := TvsHTTPServer.Create(nil);
> eHTTP.LogFile := 'httplog.log';
> eHTTP.ServerName := 'Visual Synapse Demo HTTP Server';
> eHTTP.ListenPort := '8000';
> eHTTP.SSL := False;
> eHTTP.ListenIP := '0.0.0.0'; //any
> eHTTP.RegisterDir ('/home/touzeau/Desktop/visualserverdemo/web', '/');
> eHTTP.RegisterDefaultDoc('index.htm');
> eHTTP.Active := True;
> // eHTTP.OnGet := @App.Listen; //not working it seems that here i can
> receive requests from clients.
>
> App.Initialize;
> App.Title := 'Console www.';
> App.Run;
> App.Free;
> end.
>
> //*************************************************************************************************
>
> --
>
> David Touzeau -------------------------- Linux Ubuntu Dapper 6.0.6
> FreePascal-Lazarus,perl,delphi,php icq:160018849
>
>
> ------------------------------
>
> Message: 6
> Date: Fri, 6 Oct 2006 10:26:24 -0600
> From: "Ken G. Brown" <kbrown at mac.com>
> Subject: [fpc-pascal] THREADVARLIST_FVCOMMON & THREADVARLIST_MEMORY
> undefined symbols while linking
> To: fpc-pascal at lists.freepascal.org
> Message-ID: <p06240405c14c33672a40@[169.254.1.2]>
> Content-Type: text/plain; charset="us-ascii"
>
> Downloaded fpc 2.0.4 yesterday and I am trying to compile a legacy CW Pro
> 2 app on Mac 10.4.8 with Xcode 2.4.
> I am getting undefined symbols THREADVARLIST_FVCOMMON &
> THREADVARLIST_MEMORY when trying to link, and I have no clue how to get
> past this problem. I searched my hard drive and found them showing up in
> /myDevelopment/PrtTstfpc/build/PrtTstfpc.build/DerivedSources/ppc/program.s
> but do not know what this means or what to do.
> Any help would be appreciated.
> Thx
> Ken
>
>
> ------------------------------
>
> Message: 7
> Date: Sat, 07 Oct 2006 03:05:02 +0200
> From: Marc Santhoff <M.Santhoff at t-online.de>
> Subject: Re: [fpc-pascal] RE: h2pas error report
> To: FPC-Pascal users discussions <fpc-pascal at lists.freepascal.org>
> Message-ID: <1160183102.502.1.camel at localhost.das.netz>
> Content-Type: text/plain
>
> Am Donnerstag, den 05.10.2006, 22:19 -0500 schrieb Jeff Pohlmeyer:
>> > Errm, I actually forgot the obvious questions:
>> > What's wrong here? How can I get around it?
>>
>>
>> cat input.h | awk '{gsub(/\<__int64\>/," long long "); print}' >
>> output.h
>>
>> - should work, at least on Linux x86
>
> That has done the trick. At least h2pas runs through and I'll see later,
> if the type change makes any difference on windows.
>
> Many thanks Jeff,
> Marc
>
>
>
>
> ------------------------------
>
> Message: 8
> Date: Sat, 7 Oct 2006 11:37:15 +0800 (HKT)
> From: suryono_03 at kharisma.ac.id
> Subject: [fpc-pascal] Install freepascal Mysql package to kylix 3
> To: fpc-pascal at lists.freepascal.org
> Message-ID:
> <45204.10.0.0.3.1160192235.squirrel at webmail.kharisma.ac.id>
> Content-Type: text/plain;charset=iso-8859-1
>
> Hi, does anyone know how to install freepascal mysql component to kylix 3
> open edition? Or is there any database component that can be use with
> kylix 3 open edition?
>
> Thx b4.
>
> =============
>
>
>
>
>
> ------------------------------
>
> _______________________________________________
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
> End of fpc-pascal Digest, Vol 26, Issue 18
> ******************************************
>
More information about the fpc-pascal
mailing list