> How much doing all that is worth is a different question, since the calls made through this > proposed system() SQLite function would also likely be non-portable. In this very example, > there is no wc on Windows.
I would suggest renaming the proposed system() function bash() since now and in the future there may be different command line shells. The (now) new Windows 10 Anniversary Edition has the option of installing a shell that nearly runs Canonical Ubuntu Linux's BASH shell. In a few years it will likely be a routine part of Windows. See: https://msdn.microsoft.com/en-us/commandline/wsl/about Thus, at some point, Linux, OS/X and Windows will all support Bash scripts. For now, there are non-native emulators MinGW/MSys and Cygwin to provide Bash on Windows. MinGW/MSys http://www.mingw.org/wiki/msys Cygwin http://www.mingw.org/node/21 Jim Callahan Orlando, FL On Wed, Jan 11, 2017 at 5:21 PM, Warren Young <war...@etr-usa.com> wrote: > On Jan 11, 2017, at 3:11 PM, Richard Hipp <d...@sqlite.org> wrote: > > > > On 1/11/17, Scott Hess <sh...@google.com> wrote: > >> UPDATE result SET nRows = system('wc', '-l', fileNames); > >> > >> ... > >> [Though, yes, this means you'll have to use fork() and execlp() and > >> waitpid() to implement, rather than popen(). > > > > Which further means that the code would not be portable to Windows. > > There is a way to do popen() in Windows, but it’s reeealy ugly: > > https://msdn.microsoft.com/en-us/library/ms682499%28VS.85%29.aspx > > How much doing all that is worth is a different question, since the calls > made through this proposed system() SQLite function would also likely be > non-portable. In this very example, there is no wc on Windows. > > This is essentially the same problem that leads to autoconf, autosetup, > CMake, etc: you can’t write a portable Makefile, if by “portable” you > include non-POSIX OSes. > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users