help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Win32: Using system cmd to invoke batch file


From: Stephen Simpson
Subject: Re: Win32: Using system cmd to invoke batch file
Date: Wed, 17 Sep 2003 13:40:24 +1000

Okay, i think that i have figured it out...

afaik octave resides in a bash shell under cygwin. this means that the "command parameter" for octave's system command should follow bash rules. in other words path names that include spaces should be delimited within single quotes (ASCII 39 dec), AND dos / windows style path separators must be specifically quoted using the backslash token (ASCII 92 dec).

ie. filename arguements for native windows/dos commands that are embedded in the "STRING" parameter of octave's system command should be specified using any of the following formats

'DRIVE_NAME:\\FILE_NAME'

or

'DRIVE_NAME:\\PATH_PART_1\\...\\PATH_PART_N\\FILE_NAME'

or using UNC

'\\\\MACHINE_NAME\\SHARE_NAME\\FILE_NAME'

or

'\\\\MACHINE_NAME\\SHARE_NAME\\PATH_PART_1\\...\\PATH_PART_N\\FILE_NAME'

eg. say i wanted to run a batch file from within octave called "LoadUsingExcel.bat" that takes a single filename parameter, "C:\path with embedded spaces\file name.csv", then i type the following

system("LoadUsingExcel.bat 'C:\\path with embedded spaces\\file name.csv'")

hope this helps


--
----------------------------------------------------
Stephen Simpson

Gestech Pty Ltd
Unit 5, 33 Ryde Road
Pymble NSW 2073
AUSTRALIA

ph:     +61 2 9499 7677
fax:    +61 2 9499 7877
email:  s-DOT-simpson-AT-gestech-DOT-com-DOT-au
www: http://www-DOT-gestech-DOT-com-DOT-au/
----------------------------------------------------



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]