Re: [sqlite] bug with sqlite
Just to help clarify (hopefully) the Unix/Windows "reserved filename". CON: is similar to Unix's /dev/zero or /dev/null for example -- Files that already exist and have OS meaning. stdout is NOT a reserved filename...it's a predefined variable of FILE *. You cannot say "cp file stdout" on Unix like you can say "copy file con:" on Windows. CON: is a reserve filename. This program will give you a warning compling about using stdout the variable #include main() { FILE *fp1,*fp2; fp1=fopen(stdout,"w"); if (fp1 == NULL) perror("stdout reserved"); else fputs("stdout funky here",fp1); fputs("stdout console here\n",stdout); fp2=fopen("stdout","w"); if (fp2 == NULL) perror("stdout file"); else fputs("stdout file here",fp2); #ifdef _WIN32 fp1=fopen("CON","w"); if (fp1 == NULL) perror("stdout reserved"); else fputs("stdout windows console here",fp1); #endif } On Unix there are no errors. Unix allows you to create funky filenames. Visual Studio Express 2010 produces an error on the open to CON stdout reserved: Invalid argument stdout console here stdout windows console here Make sure you run this in a temporary working directoy as you'll get a really funky filename for fp1. This will run, and produce two files and the console output (fp1 is actually an error in my book but it won't tell you that without more checking like "isprint"). fp1 ends up being a funky filname based on *stdout and contains "stdout reserved here" fp2 ends up being a file called "stdout" in the directory and contains "stdout file here". Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of Simon Slavin [slav...@bigfraud.org] Sent: Tuesday, March 29, 2011 6:48 AM To: General Discussion of SQLite Database Subject: EXT :Re: [sqlite] bug with sqlite On 29 Mar 2011, at 12:38pm, Arjen Markus wrote: > is this under Windows? con is one of the reserved file names, dating > from the DOS days (or even before that). Bah. Arjen beat me to it. Yes 'con' is the filename you used to use when you wanted to talk to the CONSOLE: the terminal connected to the front of the mainframe rather than one being served using the timesharing system. It is something like what Unix means by 'stdin' and 'stdout'. > Other reserved names are aux, > nul and prn (I think there is a fifth, but I cannot remember that one). Depends which company's mainframes you used to use. But I believe some versions of DOS carried over LPT1 to LPT9 (line printer), CLOCK$ (a pseudo-device which outputs a timer count), and COM1 to COM9 channels (serial communications). > So, that has nothing to do with SQLite itself. Agreed. Other operating systems may have no trouble with a file called 'con' but have problems with other filenames, for example 'stdout'. Simon. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] bug with sqlite
On 29 Mar 2011, at 12:38pm, Arjen Markus wrote: > is this under Windows? con is one of the reserved file names, dating > from the DOS days (or even before that). Bah. Arjen beat me to it. Yes 'con' is the filename you used to use when you wanted to talk to the CONSOLE: the terminal connected to the front of the mainframe rather than one being served using the timesharing system. It is something like what Unix means by 'stdin' and 'stdout'. > Other reserved names are aux, > nul and prn (I think there is a fifth, but I cannot remember that one). Depends which company's mainframes you used to use. But I believe some versions of DOS carried over LPT1 to LPT9 (line printer), CLOCK$ (a pseudo-device which outputs a timer count), and COM1 to COM9 channels (serial communications). > So, that has nothing to do with SQLite itself. Agreed. Other operating systems may have no trouble with a file called 'con' but have problems with other filenames, for example 'stdout'. Simon. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] bug with sqlite
Windows doesn't allow "con" named fodlers or files. Marian Cascaval From: Felix Zimmermann To: sqlite-users@sqlite.org Sent: Mon, March 28, 2011 10:26:59 PM Subject: [sqlite] bug with sqlite hi why isnt it possible to create a database file with the name "con" ? i just doesnt work. no matter what file extension im taking. regrets Felix ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] bug with sqlite
Hi, is this under Windows? con is one of the reserved file names, dating from the DOS days (or even before that). Other reserved names are aux, nul and prn (I think there is a fifth, but I cannot remember that one). So, that has nothing to do with SQLite itself. Regards, Arjen On 2011-03-28 21:26, Felix Zimmermann wrote: > hi > why isnt it possible to create a database file with the name "con" ? i just > doesnt work. no matter what file extension im taking. > > regrets > Felix > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > DISCLAIMER: This message is intended exclusively for the addressee(s) and may contain confidential and privileged information. If you are not the intended recipient please notify the sender immediately and destroy this message. Unauthorized use, disclosure or copying of this message is strictly prohibited. The foundation 'Stichting Deltares', which has its seat at Delft, The Netherlands, Commercial Registration Number 41146461, is not liable in any way whatsoever for consequences and/or damages resulting from the improper, incomplete and untimely dispatch, receipt and/or content of this e-mail. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] bug with sqlite
hi why isnt it possible to create a database file with the name "con" ? i just doesnt work. no matter what file extension im taking. regrets Felix ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users