ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2011/02/11/11:32:24

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=gamma;
h=domainkey-signature:mime-version:date:message-id:subject:from:to
:content-type;
bh=fPkkW+CLDSlIwqovyqSrNEUhn1C8FSLf+7F9aNvbBnk=;
b=rrSBTe5LFKeb+GbJF6qRSFF/vq2ei2S0PhTZrgHhVmvQUYd9IHDZGnBXwgDlorjHII
aj/BffVPK2k1U6VqdDIP2XtBiNMXmXOl21LLif2DBAAwS/zPnHwh8roHHgWVEY3bmsq+
XRGO7Q2oFe00ZfpOHhSi1CrMsdhc5lU6ANnBs=
DomainKey-Signature: a=rsa-sha1; c=nofws;
d=gmail.com; s=gamma;
h=mime-version:date:message-id:subject:from:to:content-type;
b=dM/89j0HMsgHmv41FCAV897Qc5ZmgufAMZpoxkGNOzyySqQRhMD/MuQ0Ku3wKpRLny
1kcuyZBDXMtOgpnyQ8hmGSqpX0I37PIpEdKie8/1EPGXFpQFmBc47DtgshJvcr4JDW0C
sehwTeH2kHF38rRNFi9upeUGjzYHNqjHkV1x4=
MIME-Version: 1.0
Date: Fri, 11 Feb 2011 17:30:42 +0200
Message-ID: <AANLkTiku2BkHO=j+YEm4L-tCDw40o802=Lc3Mrs2Ahk0@mail.gmail.com>
Subject: findfirst/findnext question
From: Ozkan Sezer <sezeroz AT gmail DOT com>
To: djgpp AT delorie DOT com
Reply-To: djgpp AT delorie DOT com

Hi:  I don't know the internals of these functions so I have two questions:
- Does the path pointer I pass to findfirst() must stay valid until I finish
my all work with it using fnidnext() ?
- Is it safe calling findfirst() & co. multiple times, i.e. something like:
void func1 (const char *arg)
{
  struct ffblk f;
  findfirst(arg, &f);
  ...
}
void func2 ()
{
  struct ffblk f;
  if (findfirst(somepath, &f) == 0)
    func1(f.ff_name);
  ...
}

Thanks.

--
O.S.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019