[comp.lang.perl] more enhancements?

hakanson@ogicse.ogi.edu (Marion Hakanson) (03/15/90)

In the interests of portable and efficient scripts, I'd like to
request the addition of a "getwd" call, which I have often found
myself wanting.  After all, we've already got mkdir/rmdir -- I see
these in the same class of operations, which can be emulated if
the underlying OS doesn't provide a system call.

I'd also like to add my support for a "gethostname" call, and the
ability to create "ctime" style (or a more modern "standard" format,
if one exists) timestamps for human readers would also be useful.
The latter could be done by a subroutine, but I find it distasteful
to have to wield a process to get any of the above information.

-- 
Marion Hakanson         Domain: hakanson@cse.ogi.edu
                        UUCP  : {hp-pcd,tektronix}!ogicse!hakanson

jv@mh.nl (Johan Vromans) (03/16/90)

In article <8017@ogicse.ogi.edu> hakanson@ogicse.ogi.edu (Marion Hakanson) writes:

> In the interests of portable and efficient scripts, I'd like to
> request the addition of a "getwd" call, ...

I'll second this.

> I'd also like to add my support for a "gethostname" call, and the

This also.

> ability to create "ctime" style (or a more modern "standard" format,

Someone posted a 'ctime.pl' some time ago. Has anyone archived it?

	Johan

Perl hacking on HPUX again ...
--
Johan Vromans				       jv@mh.nl via internet backbones
Multihouse Automatisering bv		       uucp: ..!{uunet,hp4nl}!mh.nl!jv
Doesburgweg 7, 2803 PL Gouda, The Netherlands  phone/fax: +31 1820 62944/62500
------------------------ "Arms are made for hugging" -------------------------

meissner@osf.org (Michael Meissner) (03/16/90)

In article <JV.90Mar15140107@squirrel.mh.nl> jv@mh.nl (Johan Vromans) writes:

| In article <8017@ogicse.ogi.edu> hakanson@ogicse.ogi.edu (Marion Hakanson) writes:
| 
| > In the interests of portable and efficient scripts, I'd like to
| > request the addition of a "getwd" call, ...
| 
| I'll second this.

And on System V systems this would use getcwd.....

| > I'd also like to add my support for a "gethostname" call, and the
| 
| This also.

And if no gethostname, revert to uname.....
--
Michael Meissner	email: meissner@osf.org		phone: 617-621-8861
Open Software Foundation, 11 Cambridge Center, Cambridge, MA

Catproof is an oxymoron, Childproof is nearly so

hakanson@ogicse.ogi.edu (Marion Hakanson) (03/17/90)

And while I'm at it, I noticed just today that the one get*ent()
routine which I need is not supported: getfsent(3).  Neither is its
replacement on NFS machines everywhere, getmntent(3).  Rodents!

-- 
Marion Hakanson         Domain: hakanson@cse.ogi.edu
                        UUCP  : {hp-pcd,tektronix}!ogicse!hakanson

chip@tct.uucp (Chip Salzenberg) (03/17/90)

According to hakanson@ogicse.ogi.edu (Marion Hakanson):
>In the interests of portable and efficient scripts, I'd like to
>request the addition of a "getwd" call.

Sure -- as long as the non-BSD implementation uses Doug Gwyn's
getcwd() routine instead of the library one.  If we're going to do
this, let's do it right: getcwd() (on most versions of USG Unix) does
popen("pwd","r"), which is approximately the slowest possible way to
determine the current directory.  Doug's version uses readdir() and
stat(), and is much faster (obviously).

>I'd also like to add my support for a "gethostname" call.

And/or uname().  (Some systems have both, you know...)
-- 
Chip Salzenberg at ComDev/TCT   <chip%tct@ateng.com>, <uunet!ateng!tct!chip>
          "The Usenet, in a very real sense, does not exist."