[fpc-devel] Re: What happened to fexpand()
Jeff Pohlmeyer
yetanothergeek at yahoo.com
Thu Mar 3 12:25:28 CET 2005
Hello, Marco - thanks for your reply...
> fexpand was in unit linux because unit dos used it,
> and it wasn't supposed to be used directly.
It is well-documented in the FPC 1.0.7 manual,
( along with example code ) and no mention is
made about not using it.
> generic functions exported via a non-generic
> unit because of an internal interface
You lost me here - What means "internal interface" ?
> In sysutils it is a function:
> function ExpandFileName (Const FileName : string): String;
And what magic does this do?
It looks to me like it just calls fexpand() internally.
> We advise to use sysutils as much as possible
The documentation recommends using glob() instead
of FindFirst() on linux. That seems to imply (to me)
that non-generic functions are prefered for non-portable
programs. This doesn't seem very consistent to me.
And besides, SysUtils seems to add all sorts of bloat
to the binary, I really don't need the days-of-the-week,
months-of-the-year, and who-knows-what else in every
little executable:
program test1;
uses oldlinux;
begin
WriteLn(fexpand(paramstr(1)));
end.
program test2;
uses sysutils;
begin
WriteLn(ExpandFileName(paramstr(1)));
end.
Size is almost triple:
-rwxr-xr-x 1 jeff users 24372 Mar 3 03:59 test1
-rwxr-xr-x 1 jeff users 64408 Mar 3 03:59 test2
> Even the routines that are not 255 char clean yet
> ( like expandfilename :-) at least have interface
> definitions that allow to improve this in the future.
You are saying that expandfilename() can be "improved"
to return an ansistring, but fexpand() can't?
Thanks for the info anyway, even if it is not
what I wanted to hear :-(
- Jeff
--
__________________________________
Celebrate Yahoo!'s 10th Birthday!
Yahoo! Netrospective: 100 Moments of the Web
http://birthday.yahoo.com/netrospective/
More information about the fpc-devel
mailing list