* file-attributes returns negative integer for inode value
@ 2008-03-02 22:46 Drew Adams
2008-03-02 23:36 ` Andreas Schwab
0 siblings, 1 reply; 5+ messages in thread
From: Drew Adams @ 2008-03-02 22:46 UTC (permalink / raw)
To: emacs-pretest-bug
emacs -Q
No reliable recipe to reproduce, but for me, some directories give a
negative inode number for file-attributes. For example:
M-x (file-attributes "c:/drews-lisp-20/Screenshots") gives:
(t 1 5 5 (18378 24192) (18123 40338) (18123 40337) 0
"drwxrwxrwx" nil -3082 240391127)
The inode value here is -3082. The Elisp manual, however says that if
the integer is too large, then a cons is used for the inode value. Is
this a Windows-specific problem, perhaps?
Also, there is a typo in the doc string for `file-attributes':
...
If inode number is larger than the Emacs integer,
this is a cons cell containing two integers: first the high part,
then the low 16 bits.
"the Emacs integer" should presumably be "the largest Emacs integer".
In GNU Emacs 22.1.90.1 (i386-mingw-nt5.1.2600)
of 2008-01-30 on PRETEST
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --cflags -Ic:/gnuwin32/include'
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: file-attributes returns negative integer for inode value
2008-03-02 22:46 file-attributes returns negative integer for inode value Drew Adams
@ 2008-03-02 23:36 ` Andreas Schwab
2008-03-03 0:12 ` Drew Adams
0 siblings, 1 reply; 5+ messages in thread
From: Andreas Schwab @ 2008-03-02 23:36 UTC (permalink / raw)
To: Drew Adams; +Cc: emacs-pretest-bug
"Drew Adams" <drew.adams@oracle.com> writes:
> No reliable recipe to reproduce, but for me, some directories give a
> negative inode number for file-attributes. For example:
>
> M-x (file-attributes "c:/drews-lisp-20/Screenshots") gives:
>
> (t 1 5 5 (18378 24192) (18123 40338) (18123 40337) 0
> "drwxrwxrwx" nil -3082 240391127)
>
> The inode value here is -3082.
And what's the real ino?
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: file-attributes returns negative integer for inode value
2008-03-02 23:36 ` Andreas Schwab
@ 2008-03-03 0:12 ` Drew Adams
2008-03-03 4:25 ` Eli Zaretskii
0 siblings, 1 reply; 5+ messages in thread
From: Drew Adams @ 2008-03-03 0:12 UTC (permalink / raw)
To: 'Andreas Schwab'; +Cc: emacs-pretest-bug
> > No reliable recipe to reproduce, but for me, some directories give a
> > negative inode number for file-attributes. For example:
> >
> > M-x (file-attributes "c:/drews-lisp-20/Screenshots") gives:
> >
> > (t 1 5 5 (18378 24192) (18123 40338) (18123 40337) 0
> > "drwxrwxrwx" nil -3082 240391127)
> >
> > The inode value here is -3082.
>
> And what's the real ino?
Dunno. How do I tell that on Windows?
But I doubt you need that info to discover the problem, anyway. I suspect it
is a problem on Windows in the code that detects a too-large integer and
returns a cons in its place.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: file-attributes returns negative integer for inode value
2008-03-03 0:12 ` Drew Adams
@ 2008-03-03 4:25 ` Eli Zaretskii
2008-03-14 17:31 ` Eli Zaretskii
0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2008-03-03 4:25 UTC (permalink / raw)
To: Drew Adams; +Cc: schwab, emacs-pretest-bug
> From: "Drew Adams" <drew.adams@oracle.com>
> Date: Sun, 2 Mar 2008 16:12:59 -0800
> Cc: emacs-pretest-bug@gnu.org
>
> > > M-x (file-attributes "c:/drews-lisp-20/Screenshots") gives:
> > >
> > > (t 1 5 5 (18378 24192) (18123 40338) (18123 40337) 0
> > > "drwxrwxrwx" nil -3082 240391127)
> > >
> > > The inode value here is -3082.
> >
> > And what's the real ino?
>
> Dunno. How do I tell that on Windows?
One way is to run "ls -i" on that file. You will need ls.exe from the
GnuWin32 port of Coreutils. Note that the w32 emulation of `stat' in
the Windows port of Emacs does not use the real inode value verbatim,
it mangles it with bit-shift and XOR operations. This is because the
inode is a 48-bit value, while sys/stat.h on Windows says the inode is
a 16-bit field.
> But I doubt you need that info to discover the problem, anyway. I suspect it
> is a problem on Windows in the code that detects a too-large integer and
> returns a cons in its place.
The problem is a little bit different: obviously, a 16-bit value
cannot overflow ab EMACS_INT. The problem is we don't keep the value
positive. I will work on this soon.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: file-attributes returns negative integer for inode value
2008-03-03 4:25 ` Eli Zaretskii
@ 2008-03-14 17:31 ` Eli Zaretskii
0 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2008-03-14 17:31 UTC (permalink / raw)
To: drew.adams, emacs-pretest-bug
> Date: Mon, 03 Mar 2008 06:25:42 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: schwab@suse.de, emacs-pretest-bug@gnu.org
>
> The problem is a little bit different: obviously, a 16-bit value
> cannot overflow ab EMACS_INT. The problem is we don't keep the value
> positive. I will work on this soon.
(For some value of "soon".)
Done.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-03-14 17:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-02 22:46 file-attributes returns negative integer for inode value Drew Adams
2008-03-02 23:36 ` Andreas Schwab
2008-03-03 0:12 ` Drew Adams
2008-03-03 4:25 ` Eli Zaretskii
2008-03-14 17:31 ` Eli Zaretskii
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).