Thread View: news.software.readers
3 messages
3 total messages
Started by Robert Brown
Fri, 11 Mar 1994 18:15
trn 3.4.1 bug: lots of mkdir messages
Author: Robert Brown
Date: Fri, 11 Mar 1994 18:15
Date: Fri, 11 Mar 1994 18:15
24 lines
1653 bytes
1653 bytes
Every time I save an article, I get a bunch of messages from mkdir.
For example, I get this when saving an article in alt.food.fat-free:
mkdir: /disks/lazarus/home2/robertb: File exists
mkdir: /disks/lazarus/home2/robertb/news: File exists
mkdir: /disks/lazarus/home2/robertb/news/barra: File exists
mkdir: /disks/lazarus/home2/robertb/news/barra/alt.food.fat-free: File exists
I know that this is occurring before my save script starts up because
I explicitly put a diagnostic (which gets flushed, by the way) which
doesn't come up 'til after this mkdir stuff.
Everything seems to be working otherwise.
Anyone else having this problem? Could I have built trn 3.4.1 in an
incorrect way?
Thanks for any help.
---
Robert Brown Work address: BARRA
Internet: robertb@barra.com 1995 University Ave. Suite 400
Phone: (510) 548-5442 Berkeley, CA 94704
* * * Newsfeed is unreliable; e-mail is better * * *
Re: trn 3.4.1 bug: lots of mkdir messages
Author: Wayne Davison
Date: Tue, 15 Mar 1994 23:49
Date: Tue, 15 Mar 1994 23:49
25 lines
1783 bytes
1783 bytes
According to Robert Brown <robertb@Barra.COM>:
> Every time I save an article, I get a bunch of messages from mkdir.
There's a function in util.c that checks how much of the path to which
you are trying to save already exists and runs the "mkdir" command on
the bits that it doesn't find.
First, ensure that the MAKEDIR define is set to TRUE in common.h (it
should be). If so, what might be happening is that the line:
if (stat(dirname,&filestat) >= 0 && (filestat.st_mode & S_IFDIR)) {
is not returning the fact that existing directories on your system are
in fact existing directories. I have a hard time believing that your
system is messing up on such a simple thing, but maybe trn was compiled
with a link file that had the wrong definition for S_IFDIR? I'm not sure
if that's possible, but I've heard of weird systems before.
If you don't see anything wrong with your include files, either debug the
makedir() function in util.c or try setting MAKEDIR FALSE in common.h and
recompiling -- you may have better luck with the shell script version of
makedir.
--
Wayne Davison
davison@borland.com
Re: trn 3.4.1 bug: lots of mkdir messages
Author: Guy Harris
Date: Wed, 16 Mar 1994 21:46
Date: Wed, 16 Mar 1994 21:46
23 lines
1912 bytes
1912 bytes
>First, ensure that the MAKEDIR define is set to TRUE in common.h (it
>should be). If so, what might be happening is that the line:
>
> if (stat(dirname,&filestat) >= 0 && (filestat.st_mode & S_IFDIR)) {
S_IFDIR is *NOT* a flag bit - it's a value! One should not test whether
a file is a directory or not by testing whether the file's mode, ANDed
with S_IFDIR, is non-zero.
The correct way of checking to see whether the file in question is a
directory would be:
if (stat(dirname,&filestat) >= 0
&& (filestat.st_mode & S_IFMT) == S_IFDIR) {
even if the code, as written, happens to work in most cases. S_IFDIR
on most UNIX systems is 040000; on those systems, (st_mode & S_IFDIR)
tests whether that bit is set, and it happens to be set on block special
files and sockets, as well as on directories. It may well be that said
test doesn't cause problems, given that "stat()" should never return
S_IFLNK as a file type, and that block special files and sockets are
rare files, but it's unwise to do the test in that fashion, even if, at
least on those systems, you can usually get away with it.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads