RE : [fpc-pascal] DateTimeToFileDate

2011-05-19 Thread Ludo Brands
Delphi FileDate is UTC time based because the windows API FILETIME structure
is UTC based. Delphi exposes the FileTimeToLocalFileTime API call to get the
local time.
The fpc unix implementation uses LocalToEpoch (unixutil.pp) which has the
folloxing comments:
{
  Transforms local time (year,month,day,hour,minutes,second) to Epoch time
   (seconds since 00:00, january 1 1970, corrected for local time zone)
}

I guess fpc wants to be Delphi compatible as much as possible.  

Ludo


-Message d'origine-
De : fpc-pascal-boun...@lists.freepascal.org
[mailto:fpc-pascal-boun...@lists.freepascal.org] De la part de Carsten Bager
Envoyé : jeudi 19 mai 2011 08:58
À : FPC-Pascal users discussions
Objet : [fpc-pascal] DateTimeToFileDate


If I do this on a Linux machine

(Free Pascal Compiler version 2.4.2 [2010/11/08] for i386)

  WriteLn(DateTimeToFileDate(Now));
  WriteLn(trunc((now-EncodeDate(1970,1,1))*86400));

I get this
1305786833
1305794033

There is a difference of 7200= 2 hours. 

Is this correct?

I would not expect a difference of 2 hours (the deference from UTC).

Regards
Carsten

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


RE : RE : [fpc-pascal] DateTimeToFileDate

2011-05-19 Thread Ludo Brands
The other reason for doing so is that unix stores internally all dates as
UTC, including the dates used in the file system.

Ludo

-Message d'origine-
De : fpc-pascal-boun...@lists.freepascal.org
[mailto:fpc-pascal-boun...@lists.freepascal.org] De la part de Ludo Brands
Envoyé : jeudi 19 mai 2011 09:36
À : cars...@beas.dk; 'FPC-Pascal users discussions'
Objet : RE : [fpc-pascal] DateTimeToFileDate


Delphi FileDate is UTC time based because the windows API FILETIME structure
is UTC based. Delphi exposes the FileTimeToLocalFileTime API call to get the
local time. The fpc unix implementation uses LocalToEpoch (unixutil.pp)
which has the folloxing comments: {
  Transforms local time (year,month,day,hour,minutes,second) to Epoch time
   (seconds since 00:00, january 1 1970, corrected for local time zone) }

I guess fpc wants to be Delphi compatible as much as possible.  

Ludo


-Message d'origine-
De : fpc-pascal-boun...@lists.freepascal.org
[mailto:fpc-pascal-boun...@lists.freepascal.org] De la part de Carsten Bager
Envoyé : jeudi 19 mai 2011 08:58 À : FPC-Pascal users discussions Objet :
[fpc-pascal] DateTimeToFileDate


If I do this on a Linux machine

(Free Pascal Compiler version 2.4.2 [2010/11/08] for i386)

  WriteLn(DateTimeToFileDate(Now));
  WriteLn(trunc((now-EncodeDate(1970,1,1))*86400));

I get this
1305786833
1305794033

There is a difference of 7200= 2 hours. 

Is this correct?

I would not expect a difference of 2 hours (the deference from UTC).

Regards
Carsten

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: RE : Re: URIParser

2011-05-19 Thread Ben
On 18/05/2011 16:56, michael.vancann...@wisa.be wrote:
> 
> Great. 
> In that case I just declare that URIParser will only work for ftp and http
> protocols :-)

What about file protocols like the 'text/uri-list' mime type? Such as
what X11's XDND uses when you drag and drop from a local application
window to a remote application window? In such cases one should supply
the username and password with the origin host. Or like Qt4 DND and
newer Windows DND applications uses.

eg:  text/url-list mime type

  file://ben:password@192.168.0.14:/home/ben/myfile.txt


I presume (though that always tends to be a bad thing) that because
text/uri-list [as in my example above] should be ok with the FPC
URIParser because it has the protocol 'file://' in the front - so
authority info shouldn't be a problem? After all, file:// is pretty much
identical to ftp:// URI syntax.



-- 

Ben.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: RE : Re: URIParser

2011-05-19 Thread ik
On Thu, May 19, 2011 at 15:38, Ben  wrote:

> On 18/05/2011 16:56, michael.vancann...@wisa.be wrote:
> >
> > Great.
> > In that case I just declare that URIParser will only work for ftp and
> http
> > protocols :-)
>
> What about file protocols like the 'text/uri-list' mime type? Such as
> what X11's XDND uses when you drag and drop from a local application
> window to a remote application window? In such cases one should supply
> the username and password with the origin host. Or like Qt4 DND and
> newer Windows DND applications uses.
>
> eg:  text/url-list mime type
>
>  file://ben:password@192.168.0.14:/home/ben/myfile.txt
>
>
> I presume (though that always tends to be a bad thing) that because
> text/uri-list [as in my example above] should be ok with the FPC
> URIParser because it has the protocol 'file://' in the front - so
> authority info shouldn't be a problem? After all, file:// is pretty much
> identical to ftp:// URI syntax.
>

After a lot of careful investigation and mostly reading, I think that you
can not really create a general purpose URI parser.
It seems though that the FPC implementation is a *URL* and not a full URI
parser, and I think it's better to document about it further.
For example there are no URN support at all and it works only for specific
type of URL that are mostly common, like the example you placed here.


>
>
>
> --
>
>Ben.
>

Ido

>
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>




LINESIP - Opening the source for communication
http://www.linesip.com
http://www.linesip.co.il
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Redirecting input to a child process

2011-05-19 Thread Anton Shepelev
Michael Van Canneyt:

> The  interface  of  the  pipes unit can be changed
> with a parameter with a default value, so existing
> code continues to work.

Yes,  but  all  the platform-specific pipe.inc files
and pipes.pp will have to be changed anyway  because
the  CreatePipeHandles  will have a different proto-
type. I wasn't sure if it  would  be  OK  to  add  a
parameter  to  the  definition  of  a cross-platform
function that would be used only on one one platform
and ignored on all the other ones.

I will write a patch then.

Anton
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: 64 bit ?

2011-05-19 Thread leledumbo
I'm not an 64-bit user, but if you need target specific optimization, passing
-Op and/or -Cf might help. Call fpc -i for possible values.

--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/64-bit-tp4408519p4410174.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Redirecting input to a child process

2011-05-19 Thread Anton Shepelev
Sorry, I forgot to say the patch is against verstion
2.4.2.

Anton
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] PowerPC Linux and endian modes

2011-05-19 Thread Seth Grover
Greetings!

Wikipedia (http://en.wikipedia.org/wiki/PowerPC#Endian_modes) states:

"Most PowerPC chips switch endianness via a bit in the MSR (Machine
State Register), with a second bit provided to allow the OS to run
with a different endianness."

So the way I am understanding this is that the PPC architecture is
capable of running in little-endian mode depending on a register flag
that can be set. And that's about the end of my knowledge on the
subject.

My question is this: does anyone have any experience with running PPC
in little endian mode? And would FPC-compiled programs (specifically
I'm cross compiling to powerpc-linux from x86_64-linux) targeted at
PPC work in a little endian mode setup?

Thanks,

-SG

--
This email is fiction. Any resemblance to actual events
or persons living or dead is purely coincidental.

Seth Grover
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] PowerPC Linux and endian modes

2011-05-19 Thread Henry Vermaak
On 19 May 2011 23:39, Seth Grover  wrote:
> Greetings!
>
> Wikipedia (http://en.wikipedia.org/wiki/PowerPC#Endian_modes) states:
>
> "Most PowerPC chips switch endianness via a bit in the MSR (Machine
> State Register), with a second bit provided to allow the OS to run
> with a different endianness."
>
> So the way I am understanding this is that the PPC architecture is
> capable of running in little-endian mode depending on a register flag
> that can be set. And that's about the end of my knowledge on the
> subject.
>
> My question is this: does anyone have any experience with running PPC
> in little endian mode? And would FPC-compiled programs (specifically
> I'm cross compiling to powerpc-linux from x86_64-linux) targeted at
> PPC work in a little endian mode setup?

Sorry, I don't.  You definitely have to fiddle with the endian
settings under the relevant section of compiler/systems/i_linux.pas
before you build your cross compiler, though.

Henry
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal