Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2011-06

question about TSearchRec

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

zeljko

Hi all,
Just tried something with file searching and cannot remember if it's different from dcc. fpc-2.4.3 on linux.

sr: TSearchRec;
if FindFirst('/blah/*,fileAttr, sr)

  repeat
    // here
   sr.PathOnly is empty .... ok
   but in case of filename
   sr.FileName is extracted so there's no file path inside filename or even

written to sr.PathOnly.

  until FindNext() = 0;
end;

So, is it different from dcc ? afaik I didn't make acrobations with this under kylix (remember each level of dir) because filename already contained path. Anyone ?

zeljko

Reply by email

Michael Van Canneyt
to zeljko
zeljko wrote 9 lines
Hi all, Just tried something with file searching and cannot remember if it's different from dcc. fpc-2.4.3 on linux. sr: TSearchRec; if FindFirst('/blah/*,fileAttr, sr) repeat // here sr.PathOnly is empty .... ok

Don't use PathOnly, it is deprecated and scheduled for removal.

but in case of filename sr.FileName is extracted so there's no file path inside filename or even written to sr.PathOnly.

FileName does not exist. Only Name exists, and it contains just the filename part.

Show quoted text 7 lines
until FindNext() = 0; end; So, is it different from dcc ? afaik I didn't make acrobations with this under kylix (remember each level of dir) because filename already contained path. Anyone ?

You must always remember the directory.
I do this since day 1.

Michael.

Reply by email

zeljko
to Michael Van Canneyt
Michael Van Canneyt wrote
FileName does not exist. Only Name exists, and it contains just the filename part.

yes, typo ...

Show quoted text 11 lines
> until FindNext() = 0; > > end; > > So, is it different from dcc ? afaik I didn't make acrobations with this > under kylix (remember each level of dir) because filename already > contained path. Anyone ? You must always remember the directory. I do this since day 1.

ok, thanks.

zeljko

Reply by email