Chdir problem
GCC Consulting
gcc at optonline.net
Wed Sep 1 18:18:52 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: Wednesday, September 01, 2004 9:03 PM
> To: 'filePro Mailing List'
> Subject: Re: Chdir problem
>
> Only Kenneth Brody would say something like:
> >
> > Actually, no translation is done or needed, as Windows
> works just fine
> > with forward slashes.
>
> Indeed it does.
>
> > I'm not sure which part of the name changes, since your
> arrows point
> > to the path separator. I'll assume for now that "macy" is
> the part that changes.
> > Adjust this as needed.
>
> The joys of proportional fonts in email. :-/
>
> > Use opendir/@dirlist/closedir to read everything in the
> "c:/edata/Geis-A"
> > directory. You can then build the fill path and use
> EXISTS() to see
> > if the file "c:/edata/Geis-A/"{name{"/ANSI/997/all/997.rpt"
> exists.
> > If it does, you can then use @FSTAT[] to check the
> modification date.
>
> Problem being, what if someone sticks a file in
> c:/edata/Geis-A instead of a directory? What -exactly- will
> fP's opendir do? Based on opendir(3), which I assume you're
> basically wrapping, they return a NULL. What does fP do in
> this context?
The person who controls this directory is my EDI programmer.
The personal at my client work with the programs they have available on their
desktops. When not doing that, they are either on the web(with their boss's
permission) or listening to music.
Could this happen, yes, but highly unlikely. Remember, this is a fairly long
directory structure and if I tried to chdir to a file, I'll assume that I would
get an error.
>
> For that matter, what does fP's open() do if you try to open
> a directory?
> :) I've seen a variety of behavior. vim will actually give
> you the list of files in the directory to edit, for example.
>
> Is there any way in fP to safely distinguish between file and
> directory? I actually need to know this for something
> someone wants written--technically I could live without it
> and mandate, "No directories shall be present!" in my case,
> but it would be nice to be able to bullet-proof it the way
> I'm used to doing things.
Ken is probably the best one to answer this question.
>
> And besides that, files get dumped in weird places sometimes.
> Someone could dump a core in a directory where you expect
> only directories and it wouldn't even be intentional, and
> half the people out there would never even notice they'd done
> it. That's actually being generous, probably.
> So I really don't like to make assumptions about what will
> and won't be present.
>
Not usually a problem in windows. Don't get a chance to save core dumps.
Richard Kreiss
GCC Consulting
More information about the Filepro-list
mailing list