Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Console question

Console question

Scheduled Pinned Locked Moved C / C++ / MFC
questionlinuxworkspace
7 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    alex barylski
    wrote on last edited by
    #1

    I need to call a console application passing it information via CLI. How is that data passed in? I know it's retreived through args, argc... Are they internally stored in environment variables? or passed in using streams??? Most Importantly: ================= Whats the buffer capacity when using the command line? Could I pass buffers as large as 10MB or so using the CLI? Storing the data in a file and opening that file isn't an option...I need actually pass X number of bytes via the command line. Or a process which is cross platform friendly (Windows/Linux) Cheers :)

    It's frustrating being a genius and living the life of a moron!!!

    W T V 3 Replies Last reply
    0
    • A alex barylski

      I need to call a console application passing it information via CLI. How is that data passed in? I know it's retreived through args, argc... Are they internally stored in environment variables? or passed in using streams??? Most Importantly: ================= Whats the buffer capacity when using the command line? Could I pass buffers as large as 10MB or so using the CLI? Storing the data in a file and opening that file isn't an option...I need actually pass X number of bytes via the command line. Or a process which is cross platform friendly (Windows/Linux) Cheers :)

      It's frustrating being a genius and living the life of a moron!!!

      W Offline
      W Offline
      Waldermort
      wrote on last edited by
      #2

      The strings are passed in as char*, basic c type strings. I remember reading somewhere about a 1024 byte limit on the command line, but I cannot find anything on MSDN to support this, so I may be wrong. I really wouldn't pass a 10mb like this though. Why is using a file not an option? Why don't you look at memory mapped files, which can use the system pagefile, though the calling format is different on linux.

      A 1 Reply Last reply
      0
      • A alex barylski

        I need to call a console application passing it information via CLI. How is that data passed in? I know it's retreived through args, argc... Are they internally stored in environment variables? or passed in using streams??? Most Importantly: ================= Whats the buffer capacity when using the command line? Could I pass buffers as large as 10MB or so using the CLI? Storing the data in a file and opening that file isn't an option...I need actually pass X number of bytes via the command line. Or a process which is cross platform friendly (Windows/Linux) Cheers :)

        It's frustrating being a genius and living the life of a moron!!!

        T Offline
        T Offline
        toxcct
        wrote on last edited by
        #3

        CLI ? here[^]


        TOXCCT >>> GEII power

        [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ]

        B 1 Reply Last reply
        0
        • T toxcct

          CLI ? here[^]


          TOXCCT >>> GEII power

          [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ]

          B Offline
          B Offline
          benjymous
          wrote on last edited by
          #4

          I think he meant Command Line Interface, not C++/CLI

          -- Help me! I'm turning into a grapefruit! Buzzwords!

          T 1 Reply Last reply
          0
          • B benjymous

            I think he meant Command Line Interface, not C++/CLI

            -- Help me! I'm turning into a grapefruit! Buzzwords!

            T Offline
            T Offline
            toxcct
            wrote on last edited by
            #5

            :-O


            TOXCCT >>> GEII power

            [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ]

            1 Reply Last reply
            0
            • W Waldermort

              The strings are passed in as char*, basic c type strings. I remember reading somewhere about a 1024 byte limit on the command line, but I cannot find anything on MSDN to support this, so I may be wrong. I really wouldn't pass a 10mb like this though. Why is using a file not an option? Why don't you look at memory mapped files, which can use the system pagefile, though the calling format is different on linux.

              A Offline
              A Offline
              alex barylski
              wrote on last edited by
              #6

              It's hard to explain why files are not allowed, but basically it's because the caller is written in PHP, executed on linux. PHP has to pass a variable data input, which I would have to first create some randomized file name, worry about file locking, etc... It'd be much easier to just pass in a buffer. :P I'll have to re-examine the situtation I guess...as I was sure there was a limit on CLI buffer sizes Cheers :)

              It's frustrating being a genius and living the life of a moron!!!

              1 Reply Last reply
              0
              • A alex barylski

                I need to call a console application passing it information via CLI. How is that data passed in? I know it's retreived through args, argc... Are they internally stored in environment variables? or passed in using streams??? Most Importantly: ================= Whats the buffer capacity when using the command line? Could I pass buffers as large as 10MB or so using the CLI? Storing the data in a file and opening that file isn't an option...I need actually pass X number of bytes via the command line. Or a process which is cross platform friendly (Windows/Linux) Cheers :)

                It's frustrating being a genius and living the life of a moron!!!

                V Offline
                V Offline
                vinclaro001
                wrote on last edited by
                #7

                I'd look at using something like shared memory - you can then use the argc/argv parameters to pass an address or token to access it. Named Pipes would also be a good solution I think. There are plenty of cross-platform implementations for this... ...unless you're passing information between Windows and Linux in separate processes. Then you will probably either have to create a file. If you wanted to go to a little more trouble maybe using TCP sockets would work?

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups