Revision history for KeyPgIsredirected


Revision [22004]

Last edited on 2017-11-21 01:11:17 by JeffMarshall [fix page link name case]
Additions:
- ##[[KeyPgReset|Reset(streamno)]]##
Deletions:
- ##[[KeyPgreset|Reset(streamno)]]##


Revision [20285]

Edited on 2016-02-10 16:01:51 by DkLwikki [Update link format]
Additions:
[[KeyPgDeclare|declare]] [[KeyPgFunction|function]] **""IsRedirected""** ( [[KeyPgByval|byval]] //is_input// [[KeyPgAs|as]] [[KeyPgLong|long]] = 0 ) [[KeyPgAs|as]] [[KeyPgLong|long]]
A ##[[KeyPgLong|long]]## indicating the type of information to return.
- ##[[KeyPgreset|Reset(streamno)]]##
Deletions:
[[KeyPgDeclare declare]] [[KeyPgFunction function]] **""IsRedirected""** ( [[KeyPgByval byval]] //is_input// [[KeyPgAs as]] [[KeyPgLong long]] = 0 ) [[KeyPgAs as]] [[KeyPgLong long]]
A ##[[KeyPgLong long]]## indicating the type of information to return.
- ##[[KeyPgreset Reset(streamno)]]##


Revision [17512]

Edited on 2015-04-01 12:09:32 by DkLwikki [Improve description]
Additions:
Checks whether stdin or stdout is redirected to a file
**""IsRedirected""** checks whether stdin or stdout is redirected to a file, instead of being connected to the console/terminal as usual.
Deletions:
Checking whether stdin or stdout is redirected to a file or not
**""IsRedirected""** checks whether stdin or stdout is redirected to a file or not.


Revision [17140]

Edited on 2014-08-03 04:04:34 by FxMwikki [Added link. Cleaned empty paragraphs.]
Additions:
{{fbdoc item="title" value="ISREDIRECTED"}}----
Deletions:
{{fbdoc item="title" value="IsRedirected"}}----


Revision [17138]

Edited on 2014-08-03 03:38:28 by FxMwikki [Added link. Cleaned empty paragraphs.]
Additions:
- ##[[KeyPgreset Reset(streamno)]]##
Deletions:
{{fbdoc item="lang"}}
{{fbdoc item="target"}}


Revision [17137]

Edited on 2014-08-02 10:44:25 by FxMwikki [Added Windows example. Need still someone to complement this page.]
Additions:
Dim as String redirection = " < """ & Command(0)
If Lcase(Right(Command(0), 4)) = ".exe" Then
redirection &= """"
Else
redirection &= ".exe"""
Deletions:
Dim As String redirection = " < """ & Command(0) & """"


Revision [17136]

Edited on 2014-08-02 09:05:02 by FxMwikki [Added Windows example. Need still someone to complement this page.]

No Differences

Revision [17135]

Edited on 2014-08-02 06:00:27 by FxMwikki [Added Windows example. Need still someone to complement this page.]
Additions:
Dim As String pathExe = """" & Exepath & """"
Shell("start /d " & pathExe & " /b " & fileExe & redirection & " secondprocess")
Deletions:
Dim As String pathExe = Left(Command(0), Instrrev(Command(0), "\"))
If pathExe <> "" Then pathExe = " /d " & """" & pathExe & """"
Shell("start" & pathExe & " /b " & fileExe & redirection & " secondprocess")


Revision [17134]

Edited on 2014-08-02 05:44:20 by FxMwikki [Added Windows example. Need still someone to complement this page.]
Additions:
Dim As String pathExe = Left(Command(0), Instrrev(Command(0), "\"))
If pathExe <> "" Then pathExe = " /d " & """" & pathExe & """"
Shell("start" & pathExe & " /b " & fileExe & redirection & " secondprocess")
ElseIf Command() = "secondprocess" Then '' Second process with stdin redirection
Deletions:
Dim As String pathExe = """" & Left(Command(0), Instrrev(Command(0), "\")) & """"
Shell("start /d " & pathExe & " /b " & fileExe & redirection & " secondprocess")
Elseif Command() = "secondprocess" Then '' Second process with stdin redirection


Revision [17133]

Edited on 2014-08-02 03:27:10 by FxMwikki [Added Windows example. Need still someone to complement this page.]
Additions:
{{fbdoc item="filename" value="examples/manual/system/isredirected.bas"}}%%(freebasic)
'' A Windows based example, just for the use principle
'' Self-sufficient example, using his own .exe file as dummy input file for stdin redirection
#include "fbio.bi"
'' Quotation marks wrapping for compatibility with spaces in path name
Dim As String pathExe = """" & Left(Command(0), Instrrev(Command(0), "\")) & """"
Dim As String fileExe = Mid(Command(0), Instrrev(Command(0), "\") + 1)
Dim As String redirection = " < """ & Command(0) & """"
If Command() = "" Then '' First process without stdin redirection
'' Creation of asynchronous second process with stdin redirected from file.exe
Shell("start /d " & pathExe & " /b " & fileExe & redirection & " secondprocess")
'' Check stdin redirection
Print "First process without stdin redirection: IsRedirected(-1) = "; Isredirected(-1)
'' Waiting for termination of asynchronous second process
Sleep
Elseif Command() = "secondprocess" Then '' Second process with stdin redirection
'' Check stdin redirection
Print "Second process with stdin redirection : IsRedirected(-1) = "; Isredirected(-1)
End If
%%


Revision [17132]

Edited on 2014-07-30 15:22:16 by FxMwikki [I initiated a page for IsRedirected(). Need someone to complement this.]
Additions:
A ##[[KeyPgLong long]]## indicating the type of information to return.
If ##//is_input//## is equal to non-zero (##-1##), **""IsRedirected""** checks stdin.
If ##//is_input//## is equal to zero (##0##), **""IsRedirected""** checks stdout.
Deletions:
A ##[[KeyPgLong long]]## indicating the type of information to return:
non-zero (##-1##) checks stdin
zero (##0##) checks stdout


Revision [17131]

Edited on 2014-07-30 02:53:09 by FxMwikki [I initiated a page for IsRedirected(). Need someone to complement this.]
Additions:
A ##[[KeyPgLong long]]## indicating the type of information to return:
Deletions:
A ##[[KeyPgLong long]]## indicating the type of information to return.


Revision [17127]

The oldest known version of this page was created on 2014-07-30 01:22:38 by FxMwikki [I initiated a page for IsRedirected(). Need someone to complement this.]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode