Re: [fpc-pascal] RE: Nice website
Jeff Pohlmeyer wrote: > Yes, much better! > I had not even looked at it till now. > > One suggestion: I think the sentence about the M680 should > be moved to the end of the first paragraph. Finish telling > me about what you do support first. I'm only on the second > sentence of the entire website, and already they're telling > me what the old compiler does that the new one doesn't. Agreed :) > > Other than that, it looks great! > > > - Jeff > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] RE: Nice website
Jeff Pohlmeyer wrote: > One suggestion: I think the sentence about the M680 should > be moved to the end of the first paragraph. Finish telling > me about what you do support first. I'm only on the second > sentence of the entire website, and already they're telling > me what the old compiler does that the new one doesn't. Good point. Thanks, fixed. Micha ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] findfirst and findnext on non accessible files
Marc Santhoff wrote: Hi, > trying to use FindFirst and FindNext on files I cannot detect the > difference between a failed call because of no matching file and a > failure when the file or dir is not listable by the user lacking > permissions. > > If I'd use fpstat and friends myself this would mean doing anything > doubly and having to write some code for each os in question. > > Is there any function or procedure that could help me here? Or should > the implementation of FindFirst/Next be adapted to respect users > credits? Which platform are you talking about, which FindFirst/FindNext (Dos/SysUtils) and what is the behaviour expected from you? E.g. with: --- uses Dos; var SR: SearchRec; begin FindFirst ('M:\IT\AuditPro', AnyFile, SR); WriteLn (DosError); FindClose (SR); FindFirst ('M:\IT\AuditPro\.', AnyFile, SR); WriteLn (DosError); FindClose (SR); FindFirst ('M:\IT\AuditPro\X', AnyFile, SR); WriteLn (DosError); FindClose (SR); end. === running under Win32, where I don't have access to "M:\IT\AuditPro" directory, but I have access to "M:\IT" (i.e. I can see the AuditPro directory itself), I get: 0 0 5 (where 5 corresponds to Access Denied). Note that I don't know whether "M:\IT\AuditPro\X" exists or not (but that is OK, IMHO). Tomas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] RE: Nice website
What website are you talking about ? On Wed, 28 Jun 2006 04:15:07 -0300, Florian Klaempfl <[EMAIL PROTECTED]> wrote: Jeff Pohlmeyer wrote: Yes, much better! I had not even looked at it till now. One suggestion: I think the sentence about the M680 should be moved to the end of the first paragraph. Finish telling me about what you do support first. I'm only on the second sentence of the entire website, and already they're telling me what the old compiler does that the new one doesn't. Agreed :) Other than that, it looks great! - Jeff ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal -- Rodrigo Palhano - Equipe SpeedCASE http://www.speedcase.com.br ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] RE: Nice website
On Wed, 28 Jun 2006, Rodrigo Palhano wrote: What website are you talking about ? http://www.freepascal.org/ Michael. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] RE: Nice website
Clean fast and tableless, i like it. On Wed, 28 Jun 2006 09:35:56 -0300, Michael Van Canneyt <[EMAIL PROTECTED]> wrote: On Wed, 28 Jun 2006, Rodrigo Palhano wrote: What website are you talking about ? http://www.freepascal.org/ Michael. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal -- Rodrigo Palhano - Equipe SpeedCASE http://www.speedcase.com.br ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] findfirst and findnext on non accessible files
Am Mittwoch, den 28.06.2006, 11:01 +0200 schrieb Tomas Hajny: > Which platform are you talking about, which FindFirst/FindNext > (Dos/SysUtils) and what is the behaviour expected from you? E.g. with: Sorry, I was too deep into the problem. I'm using FreeBSD as main platform for development but for the future at least Windows and Linux are targets. > --- > uses > Dos; > var > SR: SearchRec; > begin > FindFirst ('M:\IT\AuditPro', AnyFile, SR); > WriteLn (DosError); > FindClose (SR); > FindFirst ('M:\IT\AuditPro\.', AnyFile, SR); > WriteLn (DosError); > FindClose (SR); > FindFirst ('M:\IT\AuditPro\X', AnyFile, SR); > WriteLn (DosError); > FindClose (SR); > end. > === > running under Win32, where I don't have access to "M:\IT\AuditPro" > directory, but I have access to "M:\IT" (i.e. I can see the AuditPro > directory itself), I get: > > 0 > 0 > 5 > > (where 5 corresponds to Access Denied). > > Note that I don't know whether "M:\IT\AuditPro\X" exists or not (but that > is OK, IMHO). That's a result I'd expect. So I'll go digging for some "Error" or "UnixError" variable. Thanks so far, Marc ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] RE: Nice website
Yes, this website is much better. But i do not like design of top menu (especialy highlighting and i suggest you to set mininum width for it). - Original Message - From: "Rodrigo Palhano" <[EMAIL PROTECTED]> To: "FPC-Pascal users discussions" Sent: Wednesday, June 28, 2006 3:40 PM Subject: Re: [fpc-pascal] RE: Nice website Clean fast and tableless, i like it. On Wed, 28 Jun 2006 09:35:56 -0300, Michael Van Canneyt <[EMAIL PROTECTED]> wrote: On Wed, 28 Jun 2006, Rodrigo Palhano wrote: What website are you talking about ? http://www.freepascal.org/ Michael. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal -- Rodrigo Palhano - Equipe SpeedCASE http://www.speedcase.com.br ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] RE: Nice website
2006/6/28, Rodrigo Palhano <[EMAIL PROTECTED]>: What website are you talking about ? :) http://www.freepascal.org/ -- Alexandre Leclerc ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] findfirst and findnext on non accessible files
Marc Santhoff wrote: > Am Mittwoch, den 28.06.2006, 11:01 +0200 schrieb Tomas Hajny: > >> Which platform are you talking about, which FindFirst/FindNext >> (Dos/SysUtils) and what is the behaviour expected from you? E.g. with: > > Sorry, I was too deep into the problem. > > I'm using FreeBSD as main platform for development but for the future at > least Windows and Linux are targets. Still, which FindFirst are you talking about - that one from unit Dos, or that one from unit SysUtils? . . > That's a result I'd expect. So I'll go digging for some "Error" or > "UnixError" variable. No, you don't need any "UnixError". Dos.FindFirst returns errors in DosError for all platforms (it's a compatibility unit after all). SysUtils.FindFirst should return the error in its return value directly. I don't know whether the implementation for FreeBSD does it correctly at the moment, but that's how it's supposed to work, at least (=> enter it in the bug tracker if it doesn't do work like that). Tomas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] findfirst and findnext on non accessible files
Am Mittwoch, den 28.06.2006, 15:57 +0200 schrieb Marc Santhoff: > Am Mittwoch, den 28.06.2006, 11:01 +0200 schrieb Tomas Hajny: > > > Which platform are you talking about, which FindFirst/FindNext > > (Dos/SysUtils) and what is the behaviour expected from you? E.g. with: > > Sorry, I was too deep into the problem. > > I'm using FreeBSD as main platform for development but for the future at > least Windows and Linux are targets. ... > That's a result I'd expect. So I'll go digging for some "Error" or > "UnixError" variable. I did and found the implementation of FindFirst/Next on Win32 differing much from the one in rtl/unix/sysutils.pp. The only system error handled there is ENOMEM, so the error number on "permission denied" is -1 aka unknown. As far as i understand it the function "glob" in rtl/unix/sysutils.pp:469 is the place where more error handling for this case should be added. (fpc 2.0.2 release) Is this assumption correct or am I missing something? And more: are there other places where handling access rights has to be handled to stay consistent? TIA, Marc ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] findfirst and findnext on non accessible files
Am Mittwoch, den 28.06.2006, 18:13 +0200 schrieb Tomas Hajny: > Marc Santhoff wrote: > > Am Mittwoch, den 28.06.2006, 11:01 +0200 schrieb Tomas Hajny: > > > >> Which platform are you talking about, which FindFirst/FindNext > >> (Dos/SysUtils) and what is the behaviour expected from you? E.g. with: > > > > Sorry, I was too deep into the problem. > > > > I'm using FreeBSD as main platform for development but for the future at > > least Windows and Linux are targets. > > Still, which FindFirst are you talking about - that one from unit Dos, or > that one from unit SysUtils? I'm talking about sysutils since using unit dos on unix makes little sense imho. > . > . > > That's a result I'd expect. So I'll go digging for some "Error" or > > "UnixError" variable. > > No, you don't need any "UnixError". Dos.FindFirst returns errors in > DosError for all platforms (it's a compatibility unit after all). > SysUtils.FindFirst should return the error in its return value directly. I > don't know whether the implementation for FreeBSD does it correctly at the > moment, but that's how it's supposed to work, at least (=> enter it in the > bug tracker if it doesn't do work like that). I see, thanks for pointing me there. There *is* a DOS unit on unix, I don't believe it... =:-) I'll try that first before hacking up the sysutils one. Thank you! Marc ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] findfirst and findnext on non accessible files
Okay, now I tried it but got no valuable result: $ ls -lF /usr/X11R6/include/ | grep / ... drwx-- 104 root wheel8192 6 Okt 2005 nvu-1.0/ ... $ ls -lF /usr/X11R6/ | grep include/ drwxr-xr-x 76 root wheel 10240 14 Mai 00:07 include/ I am allowed to read the last one, but not the first. Your small program gives me: $ ./doserr /usr/X11R6/include/nvu-1.0/ 18 18 18 $ ./doserr /usr/X11R6/include/ 18 18 18 Back to the think tank again ... Marc ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] RE: findfirst and findnext on non accessible files
If I remember correctly, the DOS FindFirst/Next only handles shortstring-sized path names. Another "quirk" about using FindNext on Unix is that a symlink to a directory sets the faDirectory flag, and if it happens to be a circular symlink, I don't know of any way tell if it is safe to recurse into it without using fpStat or something like it. FindNext will eventually give up after several loops, but that doesn't seem like a very elegant way to handle the situation. - Jeff ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] RE: findfirst and findnext on non accessible files
Am Mittwoch, den 28.06.2006, 12:17 -0500 schrieb Jeff Pohlmeyer: > If I remember correctly, the DOS FindFirst/Next only handles > shortstring-sized path names. If possible at all I will not use DOS unit. > Another "quirk" about using FindNext on Unix is that a > symlink to a directory sets the faDirectory flag, and if it > happens to be a circular symlink, I don't know of any > way tell if it is safe to recurse into it without using fpStat > or something like it. FindNext will eventually give up after > several loops, but that doesn't seem like a very > elegant way to handle the situation. This should be no problem in principle, since the unix syscalls detect this state and fail (according to Stevens[1]). But relying on the system working properly is no good policy ... What I don't understand is why the var "errno" is not set or it's value is destroyed before Findfirst/-Next return. Does this value has to be set explicitely by using fpseterrno()? It returns always -1 in case of permission denied. Marc [1] W.Richard Stevens: "Advanced Programming in the Unix Environment" aka "THE Stevens" ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] RE: findfirst and findnext on non accessible files
On Wed, 28 Jun 2006, Marc Santhoff wrote: > Am Mittwoch, den 28.06.2006, 12:17 -0500 schrieb Jeff Pohlmeyer: > > If I remember correctly, the DOS FindFirst/Next only handles > > shortstring-sized path names. > > If possible at all I will not use DOS unit. > > > Another "quirk" about using FindNext on Unix is that a > > symlink to a directory sets the faDirectory flag, and if it > > happens to be a circular symlink, I don't know of any > > way tell if it is safe to recurse into it without using fpStat > > or something like it. FindNext will eventually give up after > > several loops, but that doesn't seem like a very > > elegant way to handle the situation. > > This should be no problem in principle, since the unix syscalls detect > this state and fail (according to Stevens[1]). But relying on the system > working properly is no good policy ... IMHO: On the contrary. If you can't trust the system, then what can you trust ? > What I don't understand is why the var "errno" is not set or it's value > is destroyed before Findfirst/-Next return. Does this value has to be > set explicitely by using fpseterrno()? It returns always -1 in case of > permission denied. You should not ever rely on SysUtils setting errno. Errno is a variable used in the Unix subsystem. It is only valid to check errno when directly executing calls from the baseunix,unix calls. SysUtils calls may or may not destroy this value, but you should not rely on this. Michael. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] RE: findfirst and findnext on non accessible files
Am Donnerstag, den 29.06.2006, 00:04 +0200 schrieb Michael Van Canneyt: > > On Wed, 28 Jun 2006, Marc Santhoff wrote: > > > Am Mittwoch, den 28.06.2006, 12:17 -0500 schrieb Jeff Pohlmeyer: > > > If I remember correctly, the DOS FindFirst/Next only handles > > > shortstring-sized path names. > > > > If possible at all I will not use DOS unit. > > > > > Another "quirk" about using FindNext on Unix is that a > > > symlink to a directory sets the faDirectory flag, and if it > > > happens to be a circular symlink, I don't know of any > > > way tell if it is safe to recurse into it without using fpStat > > > or something like it. FindNext will eventually give up after > > > several loops, but that doesn't seem like a very > > > elegant way to handle the situation. > > > > This should be no problem in principle, since the unix syscalls detect > > this state and fail (according to Stevens[1]). But relying on the system > > working properly is no good policy ... > > IMHO: > On the contrary. If you can't trust the system, then what can you trust ? Oaky, i can accept this as a guideline for viewing fpc's internals. > > What I don't understand is why the var "errno" is not set or it's value > > is destroyed before Findfirst/-Next return. Does this value has to be > > set explicitely by using fpseterrno()? It returns always -1 in case of > > permission denied. > > You should not ever rely on SysUtils setting errno. > Errno is a variable used in the Unix subsystem. > It is only valid to check errno when directly executing calls from the > baseunix,unix calls. > > SysUtils calls may or may not destroy this value, but you should not rely on > this. My approach to detect failing FindFirst/FindNext would be to do something like this: <--- rtl/unix/sysutils.pp:549 ---> Function GlobToTSearchRec (Var Info : TSearchRec) : Boolean; Var SInfo : Stat; p : Pglob; GlobSearchRec : PGlobSearchrec; begin GlobSearchRec:=Info.FindHandle; P:=GlobSearchRec^.GlobHandle; Result:=P<>Nil; If Result then begin GlobSearchRec^.GlobHandle:=P^.Next; Result:=Fpstat(GlobSearchRec^.Path+StrPas(p^.name),SInfo)>=0; +if NOT Result then + begin +fpseterrno(??? anything "legal" representing the system error); + end; Info.PathOnly:=GlobSearchRec^.Path; If Result then I'd appreciate hints on doing it this way (getting system error number by "fpgetCerrno()"?) or some better technique. If the errno variants are not reliable it could be done by 1. using an additional out-parameter value 2. changing the result from boolean to interger or longint returning the error number But both methods would break old code. Marc ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] RE: findfirst and findnext on non accessible files
On 28 Jun 06, at 23:41, Marc Santhoff wrote: > Am Mittwoch, den 28.06.2006, 12:17 -0500 schrieb Jeff Pohlmeyer: . . > What I don't understand is why the var "errno" is not set or it's value > is destroyed before Findfirst/-Next return. Does this value has to be > set explicitely by using fpseterrno()? It returns always -1 in case of > permission denied. My opinion is that SysUtils.FindFirst should return 5 in case of an error; "errno" is not portable, whereas SysUtils is supposed to support portable code. Tomas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] RE: findfirst and findnext on non accessible files
On 29 Jun 06, at 0:19, Marc Santhoff wrote: > Am Donnerstag, den 29.06.2006, 00:04 +0200 schrieb Michael Van Canneyt: . . > My approach to detect failing FindFirst/FindNext would be to do > something like this: > > <--- rtl/unix/sysutils.pp:549 ---> > Function GlobToTSearchRec (Var Info : TSearchRec) : Boolean; > > Var SInfo : Stat; > p : Pglob; > GlobSearchRec : PGlobSearchrec; > > begin > GlobSearchRec:=Info.FindHandle; > P:=GlobSearchRec^.GlobHandle; > Result:=P<>Nil; > If Result then > begin > GlobSearchRec^.GlobHandle:=P^.Next; > Result:=Fpstat(GlobSearchRec^.Path+StrPas(p^.name),SInfo)>=0; > +if NOT Result then > + begin > +fpseterrno(??? anything "legal" representing the system error); > + end; > Info.PathOnly:=GlobSearchRec^.Path; > If Result then > > > I'd appreciate hints on doing it this way (getting system error number > by "fpgetCerrno()"?) or some better technique. > > If the errno variants are not reliable it could be done by > > 1. using an additional out-parameter value > 2. changing the result from boolean to interger or longint returning the > error number > > But both methods would break old code. If I understand it correctly, GlobToTSearchRec is an internal function (not available in interface), and only used in function DoFind. Changing e.g. its return value shouldn't cause any harm. Tomas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] RE: Nice website
- Original Message - From: "Rimgaudas Laucius" <[EMAIL PROTECTED]> To: "FPC-Pascal users discussions" Sent: Wednesday, June 28, 2006 9:14 AM Subject: Re: [fpc-pascal] RE: Nice website Yes, this website is much better. But i do not like design of top menu (especialy highlighting and i suggest you to set mininum width for it). - Original Message - From: "Rodrigo Palhano" <[EMAIL PROTECTED]> To: "FPC-Pascal users discussions" Sent: Wednesday, June 28, 2006 3:40 PM Subject: Re: [fpc-pascal] RE: Nice website Clean fast and tableless, i like it. On Wed, 28 Jun 2006 09:35:56 -0300, Michael Van Canneyt <[EMAIL PROTECTED]> wrote: On Wed, 28 Jun 2006, Rodrigo Palhano wrote: What website are you talking about ? http://www.freepascal.org/ Michael. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal -- Rodrigo Palhano Nice, but a question, why is the menu on the right side?. After years and years of looking web pages one get uset to look at whatever the second column content is, as a result people are now found to be looking at the menu instead of the content :P. One can get used to it?, yes sure but out of curiosity (and I would like to think that there is some kind of good reason also) just why? Btw as mantis now have more space to show content, it looks better now :D. Jesus Reyes A. __ Correo Yahoo! Espacio para todos tus mensajes, antivirus y antispam ¡gratis! Regístrate ya - http://correo.yahoo.com.mx/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal