Filesystem()->stat()->islnk() doesn't detect links.
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=168
Reported by Mikael Brandström mikael@brandstrom.org
Current behavior:
Pike v7.1 release 6 running Hilfe v2.0 (Incremental Pike Frontend)
> Filesystem.System("/")->stat("opt")->islnk();
Result: 0
>
After applying patch below:
Pike v7.1 release 6 running Hilfe v2.0 (Incremental Pike Frontend)
> Filesystem.System("/")->stat("opt")->islnk();
Result: 1
>
I'm not sure if this patch breakes something that's dependant on Filesystem()->find() following symlinks. Anyway, currently find would do an endless recursion on circular symlinks.
--- lib/modules/Filesystem.pmod/System.pike Sun Aug 27 20:37:21 2000
+++ /opt/pike/pike/7.1.6/lib/modules/Filesystem.pmod/System.pike Thu
Aug 31 00:59:47 2000
@@ -74,7 +74,7 @@
Stdio.Stat a;
string full = combine_path(wd, file);
- if((a = file_stat("/"+root+full)))
+ if((a = file_stat("/"+root+full,1)))
{
Filesystem.Stat s = Filesystem.Stat();
s->fullpath = full;