Re: invalid char in filenames
T. Bharath [EMAIL PROTECTED] wrote Index: src/url.c === diff -u -r url.c @@ -1237,21 +1237,21 @@ /* DOS-ish file systems don't like `%' signs in them; we change it to `@'. */ #ifdef WINDOWS { char *p = file; for (p = file; *p; p++) -if ((*p == '%') || +if ((*p == '%') || + (*p == ' ') || + (*p == '\\') || + (*p == '[') || +(*p == ']') || +(*p == ':') || +(*p == ';') || +(*p == '=') || +(*p == '?') || +(*p == ',')) *p = '@'; } #endif /* WINDOWS */ You are testing for some perfectly legal characters in there, and you've missed a few illegal ones. These are the illegal characters on a Windows file system: \ / : * ?| There's no need to make the others illegal. And wouldn't it be better to change them to '_' than '@'? This is what I see other programs do. Also, why is wget testing for the '%' character? I don't understand why you are testing for WINDOWS instead of DOS in this part of the source: /* DOS-ish file systems don't like `%' signs in them; we change it to `@'. */ #ifdef WINDOWS { char *p = file; for (p = file; *p; p++) if (*p == '%') *p = '@'; } #endif /* WINDOWS */ Windows has no problems with the '%' character in file names AFAIK.
Re: invalid char in filenames
May be i may have missed some but the ones there are also illegal( some under NTFS) I had got the list . / \ [ ] : ; = , from msdn and the rest i found when i was trying to download a dynamic page The url was using get method with some parameters and the filename that was generated by wget used the same and was not succeding ther reason that i did not include . was the filename can contain an extension which is legal and the file being passed can also contain the path seperated by / so i did not include that i also donot know why wget checks for illegal characters in dos rather in windows i just retained what was there Jonas Jensen wrote: T. Bharath [EMAIL PROTECTED] wrote Index: src/url.c === diff -u -r url.c @@ -1237,21 +1237,21 @@ /* DOS-ish file systems don't like `%' signs in them; we change it to `@'. */ #ifdef WINDOWS { char *p = file; for (p = file; *p; p++) -if ((*p == '%') || +if ((*p == '%') || + (*p == ' ') || + (*p == '\\') || + (*p == '[') || +(*p == ']') || +(*p == ':') || +(*p == ';') || +(*p == '=') || +(*p == '?') || +(*p == ',')) *p = '@'; } #endif /* WINDOWS */ You are testing for some perfectly legal characters in there, and you've missed a few illegal ones. These are the illegal characters on a Windows file system: \ / : * ?| There's no need to make the others illegal. And wouldn't it be better to change them to '_' than '@'? This is what I see other programs do. Also, why is wget testing for the '%' character? I don't understand why you are testing for WINDOWS instead of DOS in this part of the source: /* DOS-ish file systems don't like `%' signs in them; we change it to `@'. */ #ifdef WINDOWS { char *p = file; for (p = file; *p; p++) if (*p == '%') *p = '@'; } #endif /* WINDOWS */ Windows has no problems with the '%' character in file names AFAIK.
Re: invalid char in filenames
May be i may have missed some but the ones there are also illegal( some under NTFS) I had got the list . / \ [ ] : ; = , from msdn and the rest i found when i was trying to download a dynamic page The url was using get method with some parameters and the filename that was generated by wget used the same and was not succeding ther reason that i did not include . was the filename can contain an extension which is legal and the file being passed can also contain the path seperated by / so i did not include that Did you test it? On my Windows machine I have a file named [];,= on my desktop right now, it causes no problems at all. When you rename a file to an illegal name in Explorer, you get the error message: A filename cannot contain any of the following characters: \ / : * ?| i also donot know why wget checks for illegal characters in dos rather in windows i just retained what was there Sure, that's what I thought. I'd like to hear a reason from the wget gurus that wrote it in the first place. It would make sense to me to test for WINDOWS or DOS or CYGWIN.
print in screen (-v) and -o option
the command wget -o log.txt -v ftp://ftp.something.com/somefile.zip with this command the program is quiet, do not print in screen, just to log file(log.txt) how to print in log.txt and in screen if i put wget ftp://ftp.something.com/somefile.zip it prints ins screen fine Thanks for your help