On Tue, 01 Dec 2009, Szak�ts Viktor wrote: > > If not then we it's redirected to sth else, i.e. pipe, file, socket. > > In filesys.c hb_fsIsDevice() function can be used for it and in *nixes > > it will work as we want but I do not know how it will work in MS-Windows > > with different shells (i.e. CMD.EXE and MSys) for different redirecting > > types (pipe (|) or file (>)). > > We should make some tests. Also in OS/2 for GCC and OpenWatcom builds. > > This code can be used for tests: > > proc main() > > ? "0:", HB_FISDEVICE( 0 ) > > ? "1:", HB_FISDEVICE( 1 ) > > ? "2:", HB_FISDEVICE( 2 ) > > return > > #pragma begindump > > #include "hbapifs.h" > > HB_FUNC( HB_FISDEVICE ) > > { > > hb_retl( hb_fsIsDevice( hb_numToHandle( hb_parnint( 1 ) ) ) ); > > } > > #pragma enddump > Looks good on win, I'm getting .F. on 1 and 2 if I > redirect output to a file.
Fine. Please also check tst.exe | grep . to check the results for pipes. I've just check that in DOS OpenWatcom builds it works as we want. > > Oops. I've forgot that FD_* constants are in .ch file for CL53 FSETDEVMOD() > > functions so we already have everything in core code so please simply add: > > FSETDEVMOD( 1, FD_TEXT ) > > FSETDEVMOD( 2, FD_TEXT ) > > or if you want to make it in more generic way which will work also for > > multi GT output (i.e. with some code which allocates many different GTCGI > > drivers with different redirection) then make: > > FSETDEVMOD( hb_gtInfo( HB_GTI_OUTPUTFD ), FD_TEXT ) > > FSETDEVMOD( hb_gtInfo( HB_GTI_ERRORFD ), FD_TEXT ) > Will commit it ASAP, I hope Maurilio can test it then. I tested DOS OpenWatcom builds and it resolved the problem. BTW in most of cases we expanded names of Clipper functions cut to 10 characters, i.e. dbSelectArea(). Maybe we should also change FSetDevMod() to FSetDevMode()? best regards, Przemek _______________________________________________ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour