Re: [fpc-pascal] FPC + fpGUI + Raspberry Pi = fantastic

2012-09-14 Thread Mark Morgan Lloyd

Graeme Geldenhuys wrote:

I even compiled and ran the more complex fpGUI apps like the GUI Forms 
Designer, DocView (help viewer), and Maximus (a sample fpGUI IDE). Even 
FPTest (my Free Pascal Unit Testing project works).


I don't believe you've mentioned Maximus here before, does it pull in 
the form designer etc.? I wonder whether it would run on Solaris 8 which 
doesn't have some of the libraries required for Lazarus?


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPC + fpGUI + Raspberry Pi = fantastic

2012-09-14 Thread Graeme Geldenhuys

On 13/09/12 23:02, Marco van de Voort wrote:

thus not hf. A month or so back, the PI foundation changed their default
distro from "wheezy" (eabi,v5) to raspbian.


So far the Raspbian image is pretty rubbish, compared to the 
pre-configure one I bought on my SD card. I guess the "raspbian" it too 
much "bleeding egde" (read super unstable). The Raspbian one has errors 
in raspi-config, so I can set my Dvorak keyboard layout. Eventually 
figuring out where the keys are in Qwerty, I managed to start X. The 
desktop that loads has NO icons, no menu items, and the menu items that 
do exist don't work. I couldn't even manage to run a lxterminal. I can't 
even exit the OpenBox session that is running - I had to Ctrl+Alt+F1 and 
then Ctrl+C to kill the X server. The mouse pointer is also really 
slugish in the X session, and freezes for a split second every 2-3 
seconds. It's like something is polling the system every 2-3 seconds, 
and freezing the UI while it does.


So for now, I'll restore back to my original Debian 6 "wheezy" (thank 
goodness I took a backup) where things worked much smoother. It might 
not be the most optimised OS for the Raspberry Pi, but it works much better.


I'll report my problems, so hopefully in the next Raspbian release 
things will work better.


Regards,
   - Graeme -

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


Re: [fpc-pascal] FPC + fpGUI + Raspberry Pi = fantastic

2012-09-14 Thread Marco van de Voort
In our previous episode, Graeme Geldenhuys said:
> So far the Raspbian image is pretty rubbish, compared to the 
> pre-configure one I bought on my SD card. I guess the "raspbian" it too 
> much "bleeding egde" (read super unstable). The Raspbian one has errors 
> in raspi-config, so I can set my Dvorak keyboard layout. Eventually 
> figuring out where the keys are in Qwerty, I managed to start X. The 
> desktop that loads has NO icons, no menu items, and the menu items that 
> do exist don't work. I couldn't even manage to run a lxterminal. I can't 
> even exit the OpenBox session that is running - I had to Ctrl+Alt+F1 and 
> then Ctrl+C to kill the X server. The mouse pointer is also really 
> slugish in the X session, and freezes for a split second every 2-3 
> seconds. It's like something is polling the system every 2-3 seconds, 
> and freezing the UI while it does.

Strange. For the the Raspbian image was a spitting image of the wheezy
install (both the process as the result). Same icons, nearly the same place,
midori still to slow to do something practical ( :-))

I don't notice performance impacts, one of the reasons to get the PI was to
get something with arm fpu. I already have armv5's enough.

Did you get the foundation recommended image, or did you get some daily
build or so?
 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Windows installer fails to add fpc binaries to PATH

2012-09-14 Thread Bart
On 9/14/12, Andrew Pennebaker  wrote:
> fpc.exe and related binaries are installed in C:\FPC\2.6.0\bin\i386-win32,
> but the installer does not add this directory to the PATH environment
> variable. Thus, opening a Command Prompt and typing "fpc" fails.

It did work perfectly on my Win7 laptop.
You might want to have"administrator privileges whilst installing
(IIRC modifying the global PATH variable requires administrator
privileges).

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


Re: [fpc-pascal] FPC + fpGUI + Raspberry Pi = fantastic

2012-09-14 Thread Graeme Geldenhuys

On 14/09/12 10:13, Marco van de Voort wrote:


Did you get the foundation recommended image, or did you get some daily
build or so?


The recommended image on this page:

   Raspbian "wheezy"  2012-08-16
 http://www.raspberrypi.org/downloads


I've just installed the "Pisces" image from the raspbian.org website. So 
I'm about to test that one now, and see how it goes.


  http://www.raspbian.org/PiscesImages



Regards,
  - Graeme -

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


Re: [fpc-pascal] FPC + fpGUI + Raspberry Pi = fantastic

2012-09-14 Thread Graeme Geldenhuys

On 14/09/12 09:10, Mark Morgan Lloyd wrote:


I don't believe you've mentioned Maximus here before, does it pull in
the form designer etc.?


Maximus is very basic at the moment. A project manager, syntax 
highlighting in editor, macro support in the settings dialogs, Find and 
Procedure List (filtered searching of current unit), build groups etc.


No debugging, code completion, code templates or code navigation yet. I 
still need to figure out how to integrate fcl-passrc parser to enable 
such features. At the moment the goal of Maximus is more an "advanced 
demo", than a full feature IDE. I like the idea of fpGUI being 
independent of any IDE.




I wonder whether it would run on Solaris 8 which
doesn't have some of the libraries required for Lazarus?


I've tested in OpenSolaris 2009 release, but I don't have Solaris 8 to 
try. I can say that I have run fpGUI executables under Linux SUSE 9.0 
(almost 10 year old distro) too, without any issues. fpGUI only needs 
the most basic X11 and Xft libraries - nothing else. This makes it work 
on just about any system that can run X11.



Regards,
  - Graeme -

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


Re: [fpc-pascal] Function for checking correct file name

2012-09-14 Thread Graeme Geldenhuys

On 12/09/12 19:51, Krzysztof wrote:

Hi,

Exists any multiplatform function which check if string contains not
allowed characters (like < > / \ on windows) for filename?



Nothing in FPC as far as I know, but once again tiOPF does provide that. 
Have a look at the tiUtils.pas unit in tiOPF v2. tiOPF is hosted on 
SourceForge.net.  You can browse the repository code online with a web 
browser if you must.


The function you are looking for is tiIsFileNameValid()

I had a quick look. It can be copied and pasted (with one helper 
function). There are no other tiOPF dependencies.



Regards,
  - Graeme -

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


Re: [fpc-pascal] Function for checking correct file name

2012-09-14 Thread Krzysztof
I just quicky googled not allowed characters and wrote this simple function:

function IsValidFilename(const AFilename: String): Boolean;
var
  c: set of Char = ['<','>',':','"','/','\','|','?','*', '%', '.'];
  i: Integer;
begin
  Result := True;
  for i:=1 to Length(AFilename) do
if AFilename[i] in c then
  Exit(False);
end;

So, problem solved. Thanks and regards
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Function for checking correct file name

2012-09-14 Thread Mark Morgan Lloyd

Krzysztof wrote:

I just quicky googled not allowed characters and wrote this simple function:

function IsValidFilename(const AFilename: String): Boolean;
var
  c: set of Char = ['<','>',':','"','/','\','|','?','*', '%', '.'];
  i: Integer;
begin
  Result := True;
  for i:=1 to Length(AFilename) do
if AFilename[i] in c then
  Exit(False);
end;

So, problem solved. Thanks and regards


But several of those are fine in filenames- just inadvisable since they 
need special quoting/escaping to get past the shell. As does ' ' which 
isn't in your list :-)


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPC + fpGUI + Raspberry Pi = fantastic

2012-09-14 Thread Mark Morgan Lloyd

Graeme Geldenhuys wrote:

On 14/09/12 09:10, Mark Morgan Lloyd wrote:


I don't believe you've mentioned Maximus here before, does it pull in
the form designer etc.?


I've tested in OpenSolaris 2009 release, but I don't have Solaris 8 to 
try. I can say that I have run fpGUI executables under Linux SUSE 9.0 
(almost 10 year old distro) too, without any issues. fpGUI only needs 
the most basic X11 and Xft libraries - nothing else. This makes it work 
on just about any system that can run X11.


I've just taken a look, and while libXft is available for Solaris 10 
(see http://wiki.lazarus.freepascal.org/Lazarus_on_Solaris) it's not 
available for Solaris 8 (SunOS 5.8). It was just an idle query... it 
might turn out to be possible to build it by taking sources of about the 
right age from e.g. Slackware 8.1, but right now I've got too much else 
on my plate to get into this.


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Function for checking correct file name

2012-09-14 Thread Mattias Gaertner

Mark Morgan Lloyd  hat am 14. September 2012
um 15:18 geschrieben:
> Krzysztof wrote:
> > I just quicky googled not allowed characters and wrote this simple function:
> >
> > function IsValidFilename(const AFilename: String): Boolean;
> > var
> > c: set of Char = ['<','>',':','"','/','\','|','?','*', '%', '.'];
> > i: Integer;
> > begin
> > Result := True;
> > for i:=1 to Length(AFilename) do
> > if AFilename[i] in c then
> > Exit(False);
> > end;
> >
> > So, problem solved. Thanks and regards
>
> But several of those are fine in filenames- just inadvisable since they
> need special quoting/escaping to get past the shell. As does ' ' which
> isn't in your list :-)

And it does not check for #0..#31, #127.


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

Re: [fpc-pascal] Function for checking correct file name

2012-09-14 Thread Howard Page-Clark

On 14/9/12 2:43, Mattias Gaertner wrote:


 > > c: set of Char = ['<','>',':','"','/','\','|','?','*', '%', '.'];



 > But several of those are fine in filenames- just inadvisable since they
 > need special quoting/escaping to get past the shell. As does ' ' which
 > isn't in your list :-)

And it does not check for #0..#31, #127.


As is so often the case, a truly cross-platform solution requires a good 
deal more care and research (and cross-platform experience) than simply 
extending a Windows-only solution.


Howard

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


Re: [fpc-pascal] Function for checking correct file name

2012-09-14 Thread Jürgen Hestermann


Am 2012-09-12 20:51, schrieb Krzysztof:

Exists any multiplatform function which check if string contains not
allowed characters (like < > / \ on windows) for filename?


The question is: Do you realy need it?

I came to the conclusion that it's very hard to determine what exactly is a 
valid file name
and that it is much easier, safer, platform independend and more future proof 
to just try
creating a file with the name. If it fails, you can check the error result for 
the reason.

And even if the file name is valid it does not prevent you from error checking 
because
other obstacles like missing rights can also prevent you from using the 
file(path) name.

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


Re: [fpc-pascal] Function for checking correct file name

2012-09-14 Thread Graeme Geldenhuys

On 14/09/12 13:48, Krzysztof wrote:

I just quicky googled not allowed characters and wrote this simple function:


Also in Windows (as far as I know), file names my not be longer than 255 
characters. So you will have to check the length of AFilename parameter too.



Regards,
  - Graeme -

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


Re: [fpc-pascal] Function for checking correct file name

2012-09-14 Thread Graeme Geldenhuys

On 14/09/12 15:02, Howard Page-Clark wrote:


As is so often the case, a truly cross-platform solution requires a good...


Under linux such a check is easy. Everything is accepted, expect for the 
NUL character.  :-)



Regards,
  - Graeme -

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


Re: [fpc-pascal] FBAdmin

2012-09-14 Thread patspiper

On 13/09/12 16:33, Ludo Brands wrote:

A few questions regarding FBAdmin:

- Will FBAdmin be backported to 2.6.1?


I can't comment on that.
  

- Will more functionality be added to it? In particular the
setting of
Forced Writes (I could perhaps supply a patch then).


Not from my side. Purpose of TFBAdmin was to provide access to the
"day-to-day" basic admin tasks such as backup/restore, user management. The
API has many more options that are not basic admin actions and that require
a minimum of knowledge and precaution. Making those available in a standard
component is opening a can of worms.
It is already quite a useful component as is. Since you are FBAdmin's 
author, and are knowledgeable in the service API, what do you recommend 
regarding the non basic admin actions? Forced Writes in particular is 
interesting as it might have to be turned off when pumping data for example.


The code itself is quite straightforward. Copy fbadmin to your project dir
and add the following:

function TFBAdmin.SetForcedWrites(Database:string; ForcedWrites: boolean):
boolean;
var
   spb:string;
begin
   result:=CheckConnected('SetForcedWrites');
  
spb:=chr(isc_action_svc_properties)+IBSPBParamSerialize(isc_spb_dbname,Datab

ase)+
 chr(isc_spb_prp_write_mode);
   if ForcedWrites then
 spb:=spb+chr(isc_spb_prp_wm_sync)
   else
 spb:=spb+chr(isc_spb_prp_wm_async);
   result:=isc_service_start(@FStatus[0], @FSvcHandle, nil, length(spb),
 @spb[1])=0;
   if not result then
 begin
 CheckError('SetForcedWrites',FStatus);
 exit;
 end;
end;


It is straight forward indeed. I had started writing similar code.

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


Re: [fpc-pascal] Function for checking correct file name

2012-09-14 Thread Jonas Maebe

On 14 Sep 2012, at 17:47, Graeme Geldenhuys wrote:

> On 14/09/12 15:02, Howard Page-Clark wrote:
>> 
>> As is so often the case, a truly cross-platform solution requires a good...
> 
> Under linux such a check is easy. Everything is accepted, expect for the NUL 
> character.  :-)

And the "/".


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


Re: [fpc-pascal] FPC + fpGUI + Raspberry Pi = fantastic

2012-09-14 Thread Graeme Geldenhuys

On 14/09/12 14:22, Mark Morgan Lloyd wrote:

It was just an idle query... it might turn out to be possible to build
it by taking sources of about the right age from e.g. Slackware 8.1, but
right now I've got too much else on my plate to get into this.


The alternative is to revert fpGUI to using the old non-Xft processed 
fonts in X11 - thus giving very ugly looking fonts. That was the 
original font support in fpGUI, but I quickly introduced Xft support to 
have better looking text in my applications. :)


Graeme.

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


Re: [fpc-pascal] FPC + fpGUI + Raspberry Pi = fantastic

2012-09-14 Thread Graeme Geldenhuys

On 14/09/12 14:22, Mark Morgan Lloyd wrote:

It was just an idle query... it might turn out to be possible to build
it by taking sources of about the right age from e.g. Slackware 8.1, but
right now I've got too much else on my plate to get into this.


Thinking about it, there is a 100% Pascal implementation of Xft. I read 
about it in the Lazarus Forums, and I think it is used in 
LCL-CustomDrawn widgetset. I don't know how complete that implementation 
is compared to the Xft library though. So if you really wanted to, you 
could use that instead of linking to the Xft library.


Regards,
  - Graeme -

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


Re: [fpc-pascal] C Enum vs. Integer

2012-09-14 Thread patspiper

On 13/09/12 22:39, Johann Glaser wrote:
@Stephano: Thanks for the link with contributed units. Actually, one 
of the USB units is from me, but a bit outdated. When my libusb 1.0 
translation (including an OOP wrapper) is done I'll update 
http://wiki.freepascal.org/Hardware_Access#libusb and the contributed 
units page again.


Pls do as it is a very useful translation. an OOP wrapper would be even 
better. Can you email me the updated unit (which is outdated)?


Keep up the good work!

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


Re: [fpc-pascal] Function for checking correct file name

2012-09-14 Thread Graeme Geldenhuys

On 14/09/12 16:50, Jonas Maebe wrote:


And the "/".


Ah yes, you are correct.


Regards,
  - Graeme -

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


Re: [fpc-pascal] Windows installer fails to add fpc binaries to PATH

2012-09-14 Thread Andrew Pennebaker
>
> It did work perfectly on my Win7 laptop.
> You might want to have"administrator privileges whilst installing
> (IIRC modifying the global PATH variable requires administrator
> privileges).


I do have administrator privileges, and the installer could be built to
modify the user's PATH variable instead of the system global PATH variable.
Not sure which one the installer currently tries. If the installer does
need to modify system global PATH, and it failed to do so, it should
display an error message about this.

here's the possibility that with your previous experience using Free
Pascal, you happened to manually modify PATH at some point, and then ran
the Free Pascal installer. Can you help us rule this out by temporarily
removing the Free Pascal binaries from your PATH, rerunning the installer,
and verifying that the installer really does modify PATH? In particular,
could you paste the results of echo %PATH% before and after you rerun the
installer?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Function for checking correct file name

2012-09-14 Thread Krzysztof
So I for sure check if file exists after creating it. Thanks for that tips.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Function for checking correct file name

2012-09-14 Thread Vinzent Höfler

On Fri, 14 Sep 2012 14:48:08 +0200, Krzysztof  wrote:

I just quicky googled not allowed characters and wrote this simple  
function:


Seems, you found one of the many (I'd suspect) wrong search results.


function IsValidFilename(const AFilename: String): Boolean;
var
  c: set of Char = ['<','>',':','"','/','\','|','?','*', '%', '.'];


Really?

|>copy con "a.b.c.%def"
|test
|^Z
|1 Datei(en) kopiert.
|
|>type "a.b.c.%def"
|test
|
|>dir a.*
|[...]
|
|14.09.2012  18:08 6 a.b.c.%def

And, actually, disallowing the '.' in a filename is really stup^Wshort-
sighted. Most files out there in the wild contain at least one.


Vinzent.

--
The most likely way for the world to be destroyed, most experts agree,
is by accident. That's where we come in; we're computer professionals.
We cause accidents.
-- Nathaniel Borenstein
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Function for checking correct file name

2012-09-14 Thread Jorge Aldo G. de F. Junior
am i the only one seeing a security risk here ?

2012/9/14 Vinzent Höfler :
> On Fri, 14 Sep 2012 14:48:08 +0200, Krzysztof  wrote:
>
>> I just quicky googled not allowed characters and wrote this simple
>> function:
>
>
> Seems, you found one of the many (I'd suspect) wrong search results.
>
>
>> function IsValidFilename(const AFilename: String): Boolean;
>> var
>>   c: set of Char = ['<','>',':','"','/','\','|','?','*', '%', '.'];
>
>
> Really?
>
> |>copy con "a.b.c.%def"
> |test
> |^Z
> |1 Datei(en) kopiert.
> |
> |>type "a.b.c.%def"
> |test
> |
> |>dir a.*
> |[...]
> |
> |14.09.2012  18:08 6 a.b.c.%def
>
> And, actually, disallowing the '.' in a filename is really stup^Wshort-
> sighted. Most files out there in the wild contain at least one.
>
>
> Vinzent.
>
> --
> The most likely way for the world to be destroyed, most experts agree,
> is by accident. That's where we come in; we're computer professionals.
> We cause accidents.
> -- Nathaniel Borenstein
>
> ___
> 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: [fpc-pascal] Windows installer fails to add fpc binaries to PATH

2012-09-14 Thread Vincent Snijders
2012/9/14 Andrew Pennebaker :
>> It did work perfectly on my Win7 laptop.
>> You might want to have"administrator privileges whilst installing
>> (IIRC modifying the global PATH variable requires administrator
>> privileges).
>
>
> I do have administrator privileges, and the installer could be built to
> modify the user's PATH variable instead of the system global PATH variable.
> Not sure which one the installer currently tries. If the installer does need
> to modify system global PATH, and it failed to do so, it should display an
> error message about this.
>
In that case is modfies the user's path variable.

> here's the possibility that with your previous experience using Free Pascal,
> you happened to manually modify PATH at some point, and then ran the Free
> Pascal installer. Can you help us rule this out by temporarily removing the
> Free Pascal binaries from your PATH, rerunning the installer, and verifying
> that the installer really does modify PATH? In particular, could you paste
> the results of echo %PATH% before and after you rerun the installer?

Well, I just checked:
http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/install/fpc.ist?view=annotate&root=fpcbuild
around line 253 and further.

It matches my experience.

Maybe you are using Windows ME or older windows versions.

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


Re: [fpc-pascal] Function for checking correct file name

2012-09-14 Thread Vinzent Höfler
On Fri, 14 Sep 2012 18:42:55 +0200, Jorge Aldo G. de F. Junior  
 wrote:



am i the only one seeing a security risk here ?


*scratching head* Which part? Care to elaborate?

I'd presume, you mean another than that I'm using Windows? ;)

I don't see how manually restricting the character set of an application-
created file name can be a security risk per se.


Vinzent.

--
The most likely way for the world to be destroyed, most experts agree,
is by accident. That's where we come in; we're computer professionals.
We cause accidents.
-- Nathaniel Borenstein
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Function for checking correct file name

2012-09-14 Thread Marco van de Voort
In our previous episode, Graeme Geldenhuys said:
> > As is so often the case, a truly cross-platform solution requires a good...
> 
> Under linux such a check is easy. Everything is accepted, expect for the 
> NUL character.  :-)

Which paths are you talking about? Paths passed to the shell or to the OS?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Function for checking correct file name

2012-09-14 Thread Krzysztof
I need only basic checking, it not need to be 100% compability with OS
specification. My program asking user for playlist name and I'm saving
it in local folder with my own extension.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Function for checking correct file name

2012-09-14 Thread Vinzent Höfler
On Fri, 14 Sep 2012 18:42:55 +0200, Jorge Aldo G. de F. Junior  
 wrote:



am i the only one seeing a security risk here ?


Now it dawns. You're thinking environment variables ("%")?


Vinzent.

--
The most likely way for the world to be destroyed, most experts agree,
is by accident. That's where we come in; we're computer professionals.
We cause accidents.
-- Nathaniel Borenstein
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPC + fpGUI + Raspberry Pi = fantastic

2012-09-14 Thread Mark Morgan Lloyd

Graeme Geldenhuys wrote:

On 14/09/12 14:22, Mark Morgan Lloyd wrote:

It was just an idle query... it might turn out to be possible to build
it by taking sources of about the right age from e.g. Slackware 8.1, but
right now I've got too much else on my plate to get into this.


The alternative is to revert fpGUI to using the old non-Xft processed 
fonts in X11 - thus giving very ugly looking fonts. That was the 
original font support in fpGUI, but I quickly introduced Xft support to 
have better looking text in my applications. :)


Is there an easy way to do that? Even if not pretty I think it might be 
useful from the POV of broadening the range of platforms that FPC can do 
GUI work on.


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPC + fpGUI + Raspberry Pi = fantastic

2012-09-14 Thread Mark Morgan Lloyd

Graeme Geldenhuys wrote:

On 14/09/12 14:22, Mark Morgan Lloyd wrote:

It was just an idle query... it might turn out to be possible to build
it by taking sources of about the right age from e.g. Slackware 8.1, but
right now I've got too much else on my plate to get into this.


Thinking about it, there is a 100% Pascal implementation of Xft. I read 
about it in the Lazarus Forums, and I think it is used in 
LCL-CustomDrawn widgetset. I don't know how complete that implementation 
is compared to the Xft library though. So if you really wanted to, you 
could use that instead of linking to the Xft library.


Interesting, and again something that could be useful as a way of 
broadening FPC's platform support.


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Function for checking correct file name

2012-09-14 Thread Vinzent Höfler

On Fri, 14 Sep 2012 18:53:53 +0200, Krzysztof  wrote:


I need only basic checking, it not need to be 100% compability with OS
specification. My program asking user for playlist name and I'm saving
it in local folder with my own extension.


Then for von Neumanns sake simply try to save it where the user asks you to
and if any error occurs, tell the user.

I mean, there are hundreds of reasons why a file write may fail, why bother
with trying to prevent just one of them? Especially because this hugely
differs between different platforms.

You still have to do error handling anyway, and IMO the user is entitled to
name his own files any way he likes - as long as the operating system  
accepts
it. But after all, the choice of operating system was his, so the blame  
goes

to someone else, not you who prevented the user to create a playlist called
"100% Ginuwine" (yes, I googled).


Vinzent.

--
The most likely way for the world to be destroyed, most experts agree,
is by accident. That's where we come in; we're computer professionals.
We cause accidents.
-- Nathaniel Borenstein
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FBAdmin

2012-09-14 Thread Ludo Brands
> It is already quite a useful component as is. Since you are FBAdmin's 
> author, and are knowledgeable in the service API, what do you 
> recommend 
> regarding the non basic admin actions? Forced Writes in particular is 
> interesting as it might have to be turned off when pumping 
> data for example.

As said before IMHO forced writes doesn't belong in a component that comes
standard with Lazarus. Google for Firebird forced writes off and you get as
first page http://www.firebirdsql.org/manual/qsg2-safety.html chapter "how
to corrupt a database". Forced Writes is a speed hack that turns off
effectively the database integrity for the time of the operation. That is
integrity in the largest sense. When something goes wrong, your complete
database can become unusable. Unless you are writing a db admin tool or a
very specialised tool, no business application should use this.  

The category of repair actions as well are only useful for db admin tools.
Perhaps setting the sweep interval or forcing a sweep could be something
that is useful for non db admin applications. An automated sweep that starts
when your app is in peak usage can be disturbing. But then again, a crontab
that launches a nightly or weekend sweep will keep you away from that also.

Ludo



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


Re: [fpc-pascal] Windows installer fails to add fpc binaries to PATH

2012-09-14 Thread Andrew Pennebaker
>
> Well, I just checked:
>
> http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/install/fpc.ist?view=annotate&root=fpcbuild
> around line 253 and further.
>
> It matches my experience.
>
> Maybe you are using Windows ME or older windows versions.


I am using Windows 7 Professional x64. Which version are you using?

Hmm...

My Windows account has full Administrative privileges. I'm curious if the
installer neglects to explicitly request administrative privileges. I bet
if we edit the installer's security properties, forcing it to run in
administrative mode, it will then modify PATH accordingly.

If this is the case, the installer should either explicitly ask the system
for administrative privileges before attempting to modify the system global
PATH. If the system grants administrative privileges, the installer should
modify the system global PATH. If the system does not grant administrative
privileges, then the installer should either modify the user's local PATH
variable instead, or display a visible popup to the effect that the
installer requires admin rights.

All of this is easily done with Advanced
Installer,
by the way. I'm not sure which tools you're using to construct the official
Free Pascal Windows installer, but the output of that build process is not
working on my system.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal