Console question
-
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!!!
-
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!!!
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.
-
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!!!
-
I think he meant Command Line Interface, not C++/CLI
-- Help me! I'm turning into a grapefruit! Buzzwords!
-
I think he meant Command Line Interface, not C++/CLI
-- Help me! I'm turning into a grapefruit! Buzzwords!
-
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.
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!!!
-
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!!!
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?