[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: gnapster won't download: "fopen: No such file or directory"



On Thu, 3 Aug 2000, Krzys Majewski wrote:

> OK, it seems to download now, though I still get the fopen() errors. 
> I like the gnapster interface but things like this, I hate to say, 
> make Windows look good at the expense of linux.. -chris

	Yup. 

	Hmm. I downloaded the source, and after a quick grep for fopen:

[msoulier@lupus src]$ grep fopen *.c
chan.c:   f = fopen(conf, flags);
chan.c:     perror("fopen");
gnapster.c:   f = fopen(download->fpath, "w");
network.c:      dl->fdesc = fopen(conv_unix(dl->file), "r");
network.c:       dl->fdesc = fopen(dl->resume_path, "a");
network.c:      download->fdesc = fopen(download->resume_path, "a");*/
network.c:       download->fdesc = fopen(download->resume_path, "a");
network.c:      download->fdesc = fopen(conv_unix(download->file), "r");
resume.c:   f = fopen(conf, flags);
resume.c:     perror("fopen");
servers.c:   f = fopen(conf, flags);
servers.c:     perror("fopen");
upload.c:   f = fopen(conf, (status == 2) ? "a" : (status ==
1) ? "w" : "r");
upload.c://      perror("fopen");

	I first suspected servers.c, but...

FILE *open_servers(char *flags) {
   FILE *f;
   char *conf;

   conf = g_strdup_printf("%s/.gnapster/servers", getenv("HOME"));
   
   f = fopen(conf, flags);

   if (!f)
     perror("fopen");

   g_free(conf);
   
   return f;
}

	This looks like it's just looking at $HOME/.gnapster/servers,
which is there, so it's probably fine. 

chan.c is the same kind of thing, opening $HOME/.gnapster/autojoin

upload.c has the perror() call commented out, so if the source agrees with
the binary package, it can't be that.

	Looking in resume.c:

FILE *open_resume(char *flags) {
   FILE *f;
   char *conf;
   
   conf = g_strdup_printf("%s/.gnapster/resume", getenv("HOME"));
   
   f = fopen(conf, flags);
   
   if (!f)
     perror("fopen");
   
   g_free(conf);
   
   return f;
}

	It's looking for $HOME/.gnapster/resume, which I don't have. I'm
not sure what that's for, resuming incomplete downloads maybe?

[msoulier@lupus src]$ grep open_resume *.c
gnapster.c:   f = open_resume("r");
resume.c:   f = open_resume("r");
resume.c:   f = open_resume("w");
resume.c:   f = open_resume("r");
resume.c:   f = open_resume("w");
resume.c:   f = open_resume("r");
resume.c:   f = open_resume("a");
resume.c:   f = open_resume("r");
resume.c:FILE *open_resume(char *flags) {

	Looks like it's called a lot, so perhaps it's being called when it
shouldn't be. It'd be worthwhile to add to the perror messages to
distinguish them to make sure that it's the right one, and then track it
down. 

	Mike



Reply to: