comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Opening/displaying a text file
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Opening/displaying a text file [message #64782] Tue, 20 January 2009 01:17 Go to previous message
Maarten[1] is currently offline  Maarten[1]
Messages: 176
Registered: November 2005
Senior Member
[cut to size in various places]

On Jan 19, 2:50 pm, jimmyb...@gmail.com wrote:
> On 19 Jan, 12:18, Gaurav <selfishgau...@gmail.com> wrote:

>>> Do I need to read in the text and re-display it or can I use
>>> a command to open that .txt file, as if it were opened seperate of
>>> IDL?
>
>> Yes, you can easily do that. Try:
>
>> SPAWN, 'notepad.exe c:\myFolder\myFile.txt', /noshell, /nowait
>
> Brilliant, worked like a charm- thanks!

Be sure to test for the OS before attempting this. Never say your code
will never be used on Linux/Mac/... and spawns like this will cause
trouble later on. Use !version.os_family or !version.os to select the
correct OS you will use this on. In your case you may want to provide
this functionalty only on Windows (at least I think that that is the
correct identifier, check for yourself):

if !version.os_family eq 'windows' then begin
spawn, notepad.exe c:\myFolder\myFile.txt', /noshell, /nowait
endif else begin
print, 'functionality not supported'
endelse

By the way, on the mac the command would be:

spawn, "open '" + filepath +"'"
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL_IDLBridge Issue
Next Topic: OT: land-sea mask

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 22:00:50 PDT 2025

Total time taken to generate the page: 1.04011 seconds