[Mono-list] Mono.Unix.Native.Syscall.(l)stat weirdness

László Monda mondalaci at gmail.com
Wed Feb 15 06:15:47 EST 2006


Hey List,

I've been playing with stat() and lstat() in the past few days and
things seem to be weird.

I made two test programs to demonstrate the problem.  The first is
written in C and behaves correctly, the second is written in C# and is
quite abnormal.  I attached both of them.


Let's see the test results on a socket file:


$ stattest-c /home/laci/.gnome-system-monitor.laci
filename: /home/laci/.gnome-system-monitor.laci

stat
        is_file: false
        is_dir: false
        is_fifo: false
        is_sock: true
        is_chardev: false
        is_blockdev: false

lstat
        is_file: false
        is_dir: false
        is_fifo: false
        is_sock: true
        is_chardev: false
        is_blockdev: false

$ mono StatTest.exe /home/laci/.gnome-system-monitor.laci
filename: /home/laci/.gnome-system-monitor.laci

stat
        is_file: true
        is_dir: true
        is_fifo: false
        is_sock: true
        is_chardev: false
        is_blockdev: false

lstat
        is_file: true
        is_dir: true
        is_fifo: false
        is_sock: true
        is_chardev: false
        is_blockdev: false

Somebody could explain what's wrong with
Mono.Unix.Native.Syscall.(l)stat?

Thanks in advance!

-- 
Laci

    Blog: http://monda.hu/~laci/blog
    Home: http://mondalaci.objectis.net

-------------- next part --------------
A non-text attachment was scrubbed...
Name: stattest.c
Type: text/x-csrc
Size: 975 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-list/attachments/20060215/68dbaf06/stattest-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: StatTest.cs
Type: text/x-csharp
Size: 1550 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-list/attachments/20060215/68dbaf06/StatTest-0001.bin


More information about the Mono-list mailing list