[Python-Dev] Help with inotify
Neal Becker
ndbecker2 at gmail.com
Thu Oct 27 21:17:29 CEST 2005
"Martin v. Löwis" wrote:
> Neal Becker wrote:
>> Yes, tried that- learned nothing.
>
> Please go back further in the trace file. There must be a return
> value of -1 (EISDIR) somewhere in the file, try to locate that.
>
>> Here's strace. The write of '4' is where my code writes the value of
>> fileno() to stdout, which is '4', which is correct - notice that
>> open("test-inotify.py") returned '3':
>
> The fragment you quote only refers to the part where it tries to
> format the traceback. The value '4' is never written, instead,
> it writes 4 spaces (the second argument is the bytes, the third
> is the number of bytes).
>
This 1st line is the syscall for inotify:
SYS_253(0, 0x7fffff88f0f0, 0x2aaaadda3f00, 0x2aaaaab4611b, 0x7) = 4
close(3) = 0
futex(0x502530, FUTEX_WAKE, 1) = 0
futex(0x502530, FUTEX_WAKE, 1) = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 3), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x2aaaadc12000
write(1, "4\n", 2) = 2
fcntl(4, F_GETFL) = 0 (flags O_RDONLY)
fstat(4, {st_mode=S_IFDIR|0600, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x2aaaadc13000
lseek(4, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
fstat(4, {st_mode=S_IFDIR|0600, st_size=0, ...}) = 0
close(4) = 0
munmap(0x2aaaadc13000, 4096) = 0
write(2, "Traceback (most recent call last"..., 35) = 35
open("test-inotify.py", O_RDONLY) = 3
write(2, " File \"test-inotify.py\", line 6"..., 39) = 39
...
More information about the Python-Dev
mailing list