Re: [fpc-pascal] fpreaddir

2008-05-01 Thread Rainer Stratmann
Am Donnerstag, 1. Mai 2008 18:58 schrieb Marc Santhoff: > What os are you on? Knoppix last DVD from heise > I did "man readdir" and "man dirent" and found enough information. One > bit from the dirent manpage: I did it also ... Other than Linux, the d_type field is available mainly only on BSD

Re: [fpc-pascal] fpreaddir

2008-05-01 Thread Marc Santhoff
Am Donnerstag, den 01.05.2008, 16:54 +0200 schrieb Rainer Stratmann: > Am Donnerstag, 1. Mai 2008 17:17 schrieb Marco van de Voort: > > d_type being > > > > DT_UNKNOWN 0 > > DT_FIFO 1 > > DT_CHR 2 > > DT_DIR 4 > > DT_BLK 6 > >

Re: [fpc-pascal] fpreaddir

2008-05-01 Thread Marco van de Voort
> Am Donnerstag, 1. Mai 2008 17:17 schrieb Marco van de Voort: > > DT_LNK 10 > > DT_SOCK 12 > > DT_WHT 14 > > > > But why do you not simply use findfirst/findnext? It's more portable. > > The result of d_type is always 0 even if the entry is a directory.

Re: [fpc-pascal] fpreaddir

2008-05-01 Thread Rainer Stratmann
Am Donnerstag, 1. Mai 2008 17:17 schrieb Marco van de Voort: > d_type being > > DT_UNKNOWN 0 > DT_FIFO 1 > DT_CHR 2 > DT_DIR 4 > DT_BLK 6 > DT_REG 8 > DT_LNK 10 > DT_SOCK 12 > DT_WH

Re: [fpc-pascal] fpreaddir

2008-05-01 Thread Marco van de Voort
> fpreaddir > -> http://www.freepascal.org/docs-html/rtl/baseunix/fpreaddir.html > > dirent record structure > -> http://www.freepascal.org/docs-html/rtl/baseunix/dirent.html > > How do I know if the readed entry is a subdir? d_type being DT_UNKNOWN 0 DT_FIFO 1 DT_CHR

[fpc-pascal] fpreaddir

2008-05-01 Thread Rainer Stratmann
fpreaddir -> http://www.freepascal.org/docs-html/rtl/baseunix/fpreaddir.html dirent record structure -> http://www.freepascal.org/docs-html/rtl/baseunix/dirent.html How do I know if the readed entry is a subdir? Rainer ___ fpc-pascal maillist - fpc

Re: [fpc-pascal] Pointers in Pascal!!

2008-05-01 Thread Mattias Gaertner
On Thu, 01 May 2008 15:23:29 +0200 Marc Weustink <[EMAIL PROTECTED]> wrote: > Mattias Gaertner wrote: >[...] > > ReAllocMem(p,0); > > Ah, now I understand why you use them :) > > Anyway does it set p:=nil ? Yes. Mattias ___ fpc-pascal maillist - fp

Re: [fpc-pascal] Pointers in Pascal!!

2008-05-01 Thread Marc Weustink
Mattias Gaertner wrote: On Wed, 30 Apr 2008 01:22:47 +0200 Marc Weustink <[EMAIL PROTECTED]> wrote: Alan Krause wrote: Hans MÃ¥rtensson wrote: But that would not work after the pointer was used and then it's memory freed. So a better way might be: Always when declaring pointers do it this w