TIP: Click on subject to list as thread! ANSI
echo: locsysop
to: Bob Lawrence
from: Paul Edwards
date: 1996-11-24 13:46:04
subject: tic

PE> */ /* as "temp.*" or "temp.c(*)"
PE> Read!!!

BL> So? Why call it dick:dobby(*$%) (or whatever it was?

Different systems use different names.  trav() is used on lots of systems.
Basically every one I visited actually.

PE> */ /*  The second is the fourth parameter you passed to trav.          

PE> Read!!!

BL> You mean you can't see anything confusing in that??? If the second
BL> is the fourth, who's on first?

How many parameters did you pass to trav?  4.  The 4th one, gets used later
on, when your function is called.

BL> 1. What the fuck does "dd:input(*)" mean? It's a great wank and
BL> it must make you feel really clever to know the secret, but
BL> what the fuck is it? My guess is something like..."C:\*.*"

PE> Did you read where it says exactly that, giving temp.* as an
PE> example?

BL> I found it impossible to understand. If I were you, I'd aim at a 
BL> slightly lower IQ level (like 100).

I think it's the nature of the beast.  MVS documentation for MVS users, DOS
documentation for DOS users, all in one.

PE> trav() must have been written originally on the mainframe,
PE> where dd:input(*) is how you refer to all members of the PDS
PE> referred to by DD input. In other words, that particular format
PE> of filename is only used for MVS. For MSDOS, use *.* etc
PE> instead. 

BL> You are doing it again. What's DD, PDS, MVS? I don't know any of

They're too difficult to explain quickly, but you don't need to know them,
they are only used on IBM mainframes.

BL> 2. in mydefunct() what the fuck is uch? I assume that fnm is a
BL> file name but what is the form of uch? I assume it's a struct
BL> with the file data in it but I could be wrong.

PE> Did you read where it tells you that it is whatever YOU
PE> specified as the fourth parameter to trav()? The example uses
PE> NULL for the 4th parameter, so you will get NULL. The example
PE> shows that parameter being ignored. You can ignore it too. 

BL> That was not my question. My question is: what the fuck is uch?

uch will be NULL, and should be ignored, ASSUMING that the 4th parameter
you passed to trav() was NULL.

PE> I provide a 4-line program to get you started. I provide more
PE> documentation in that function than I've supplied in all my
PE> other code put together. Most applications only need the
PE> filename, not the file size and date. Actually, you can get the
PE> file size portably in C. You can't get the date though.

BL> Oh, well that's great... I'll just leave a blank where it says
BL> "date".

Exactly right.  So that it still works on a straight-ISO system (where
there's no date, e.g. the C64 doesn't have a date on the files).

PE> Even then, what you do is make the date an optional feature, so
PE> that if you have an environment that has a method of obtaining
PE> a date, fine, if you don't, fine, put blanks there. At least it
PE> still works. 

BL> ROFL!!! And you call this a language... no date?

No silly assumptions that all operating systems have dates on the files, or
that they all use the intel instruction set etc, correct.

PE> There's no copy, but you can do that by opening and reading
PE> files. erase() is remove(). move() is rename(). 

BL> How do you do copy() if you don't know the date, Paul? If I rewrite
BL> the file I'll end up with today's date on it... and rename() isn't
BL> UNIX according to Borland. You call this a portable language?

rename() is part of the ISO standard.  Yes, it is not part of the
traditional Unix library.  That doesn't matter.  The compiler has to
provide it.  My compiler does.  Don't worry about it, just use it. Anything
you see with "ANSI", feel free to use.  I've got ANSI compilers
on all my platforms (except C64 I suppose, where I've only got K&R).

BL> If I use stat() on an *OPEN* file to read time, I can set time on a

And fstat() on a closed file?

BL> char     buf[1024];

BL> while (1 == 1) {
BL> ret = fread(buf, 1, 1024, in);
BL> fwrite(buf, 1, ret, out);
BL> if (ret < 1) break;
BL> }

I suppose that's not much more work than fgetc() after all.  However, you
have made the stack requirements 1024 bytes.

BL> Strange... that stat() works on an open file and utime() only works
BL> on a closed file. I love the consistency in this fucking useless language.

I'm sure I mentioned fstat() as a possibility before.  I haven't looked it
up at work yet though.  BFN.  Paul.
@EOT:

---
* Origin: X (3:711/934.9)

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.