Chdir problem
GCC Consulting
gcc at optonline.net
Tue Aug 31 22:17:16 PDT 2004
> -----Original Message-----
> From: filepro-list-bounces at lists.celestial.com
> [mailto:filepro-list-bounces at lists.celestial.com] On Behalf
> Of Fairlight
> Sent: Tuesday, August 31, 2004 11:41 PM
> To: filePro Mailing List
> Subject: Re: Chdir problem
>
> Yo, homey, in case you don' be listenin', GCC Consulting done said:
>
> > Since the EDI program( not fp) which generates the 977.rpt
> ASCII file
> > isn't printing it correctly, I want use fp to "walk" thru each
> > directory and using the system command, print the report.
> >
> > There are at least 8 possible edi customer directories
> which have to
> > be checked for a current 997.rpt file.
>
> The number should be irrelevant.
>
> You want to look at OPENDIR, NEXTDIR, CLOSEDIR, and EXISTS
> with the array @FSTAT[] in v5.x. The first three are only
> necessary if you need to actually traverse directories. If
> you just need to peek at that file in 8 locations, you could
> just use EXISTS and check @FSTAT[].
>
> >From the documentation I just read, if you do an EXISTS on a
> pathname,
> >it
> fills in that array. You get the date and time in (10,mdyy/)
> and (8,TIME) formats, respectively from elements 11 and 12 if
> you're looking at modification time.
>
> As for traversing trees, you can tell what type of file
> something is by looking at st_mode in other languages, but
> that won't work in fP because it's tied to the st_mode, and
> fP apparently truncates that to -only- the permissions part
> of the mode element, discarding the file type. I'm at a bit
> of a loss there.
>
> HTH...some. :) Directory traversal is no problem in damned
> near anything else, but I've never had to code it in fP. I'm
> not seeing any handy methodology of distinguishing between
> file and directory in the docs, since they've hacked up the
> contents of st_dev. :(
>
Thanks mark,
Both you and Ken suggested the same approach. The file type is ASCII for
997.rpt.
I'll play with this over the next few days.
My head isn't quite in to programming as I have to go back in for some more
surgery on Sept 7th.
I have a pre-surgical physical tomorrow and I expect they may keep me waiting so
I'll play with this on my laptop. This should be a fun exercise.
Richard Kreiss
GCC Consulting
More information about the Filepro-list
mailing list