locked
File Descriptor in VB.net RRS feed

  • Question

  • Hi,

    How do we set the file descriptor in VB.net

    thanks
    Wednesday, March 3, 2010 9:53 AM

Answers

  • We know what they are, They are the equivalent of LUNs or "logical unit numbers".

    The question is....how do we tell vb to make use of them.

    Renee
    • Marked as answer by Jeff Shan Wednesday, March 10, 2010 2:37 AM
    Wednesday, March 3, 2010 10:04 PM
  • As Renee said the numbers are LUNs and .Net does not deal with LUNs (at least you can't use them in the way Unix does).
    The nearest equivalents to stdin and stdout are Console.In and Console.Out - these are read only properties so you can't set them to point at some other text reader/writer.
    Here's some code from MSDN that might help you see what to to do.

    Imports
     System
    Imports System.IO

    Class InTest

    Public Shared Sub Main()
    Dim tIn As TextReader = Console.In
    Dim tOut As TextWriter = Console.Out


    tOut.WriteLine("Hola Mundo!" )
    tOut.Write("What is your name: " )
    Dim name As [String ] = tIn.ReadLine()

    tOut.WriteLine("Buenos Dias, {0}!" , name)
    End Sub 'Main
    End Class 'InTest

    • Marked as answer by Jeff Shan Wednesday, March 10, 2010 2:37 AM
    Wednesday, March 3, 2010 10:36 PM

All replies

  • what do you mean ? The description of the exe ? You can set that on your project proertties page after clicking the assembly Informtaion button . I that is not it the say what you mean .


    Coding4fun Be a good forum member mark posts that contain the answers to your questions or those that are helpful
    Please format the code in your posts with the button . Makes it easier to read . Or use the Forum Code Formatter by JohnWein http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/bf977a14-d9d4-4e84-9784-bf76b9e23261
    Wednesday, March 3, 2010 12:01 PM
  • thanks for the reply, and sorry for not being clear

    i'm trying to write and read into the standard output and input stream respectively, but instead of using the standard file descriptor (file handle) 0 - stdout,  or 1 -- stdin, I want to write using 3 and reading in 4

    code in C is something like this
    write(3, "%s", "A");


    thanks
    Wednesday, March 3, 2010 3:19 PM
  • The 3 and the 4 mean something to the language.

    Renee
    Wednesday, March 3, 2010 8:34 PM
  • I don't have a clue what the OP is saying . I understand standard input and output of a file stream but what 3 and 4 are I don't know .
    Coding4fun Be a good forum member mark posts that contain the answers to your questions or those that are helpful
    Please format the code in your posts with the button . Makes it easier to read . Or use the Forum Code Formatter by JohnWein http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/bf977a14-d9d4-4e84-9784-bf76b9e23261
    Wednesday, March 3, 2010 9:38 PM
  • We know what they are, They are the equivalent of LUNs or "logical unit numbers".

    The question is....how do we tell vb to make use of them.

    Renee
    • Marked as answer by Jeff Shan Wednesday, March 10, 2010 2:37 AM
    Wednesday, March 3, 2010 10:04 PM
  • As Renee said the numbers are LUNs and .Net does not deal with LUNs (at least you can't use them in the way Unix does).
    The nearest equivalents to stdin and stdout are Console.In and Console.Out - these are read only properties so you can't set them to point at some other text reader/writer.
    Here's some code from MSDN that might help you see what to to do.

    Imports
     System
    Imports System.IO

    Class InTest

    Public Shared Sub Main()
    Dim tIn As TextReader = Console.In
    Dim tOut As TextWriter = Console.Out


    tOut.WriteLine("Hola Mundo!" )
    tOut.Write("What is your name: " )
    Dim name As [String ] = tIn.ReadLine()

    tOut.WriteLine("Buenos Dias, {0}!" , name)
    End Sub 'Main
    End Class 'InTest

    • Marked as answer by Jeff Shan Wednesday, March 10, 2010 2:37 AM
    Wednesday, March 3, 2010 10:36 PM