USER command questions (Fairlight)
John Esak
john at valar.com
Sat Sep 12 19:50:17 PDT 2009
No, you are accessing the same array, but once you pass the file you've just
NEXTDIR'd you can't go back and do anything to something previous in the
list with NEXTDIR. I misrepresented that it was doing more system calls
with the nextdir. I find it harder to parse the @dirlist than to just use
the parts I need with @dirlist_name, etc. But I was referring originally to
your doing mv's or cp's with an ls/user combination. That I thought would
executing over and over, until I read in your note that you were getting the
ls just once and somehow working the list retrieved one at a time. Like I
said, I skipped over a quick glance at your first posting to push you
towards opendir(). Pointing to items in the 3 @dirlist_* arrays is just
easier than employing nextdir(). No savings in system calls.
JE
_____
From: Tyler [mailto:tyler.style at gmail.com]
Sent: Friday, September 11, 2009 3:36 PM
To: john at valar.com
Cc: filepro-list at lists.celestial.com
Subject: Re: Re: USER command questions (Fairlight)
On Fri, Sep 11, 2009 at 11:24 AM, John Esak <john at valar.com> wrote:
If you're going to use opehdir() as you say with SYSTEM, then do yourself
ahother favor and get rid of the NeXTDIR.. Why "execute" that command for
every file in the folder, when all you have to do is increment a counter and
it automaticlly points to the next file. I'm missing your logic here. Or,
maybe I didn't explain the @dirlist arrays wlell nough.
JE
Ah, perhaps I misunderstand how NEXTDIR works? My impression was that
NEXTDIR read from @dirlist. Does it do a separate OS call each time?
NEXTDIR is listed right after OPENDIR, and the last section in OPENDIR is
"Once you have run OPENDIR, the list is stored in the system array,
@dirlist", it made sense to me that NEXTDIR was just an easy way to step
thru said array rather than having to custom build a loop every time.
>From dev ref appendix of system maintained arrays:
"@dirlist replaces the NEXTDIR function which used to had to be run to build
a list of files found"
Why this info isn't in the entry for NEXTDIR in the dev ref or online I have
*no* idea. Seems important to mark deprecated commands and their
replacements, no???
Tyler
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.celestial.com/pipermail/filepro-list/attachments/20090912/7217275c/attachment.html
More information about the Filepro-list
mailing list