Thread: Opening Files...

  1. #1
    Not stupid, just stupider yaya's Avatar
    Join Date
    May 2007
    Location
    Earthland
    Posts
    204

    Thumbs up Opening Files...

    I was wondering if it was possible to open a file in the default program. For example, I want to open a .txt file and open it up in the notepad program--not in my program like you usually do.

    Thanks in advanced.

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    I believe there is a FAQ on this. Have you had a chance to look there?

  3. #3
    Not stupid, just stupider yaya's Avatar
    Join Date
    May 2007
    Location
    Earthland
    Posts
    204
    No, no, no--I mean open up the actuall program "Notepad" with the desired .txt file opened inside it.

    What I am doing is writing a program that allows someone to view the ReadMe.txt. When they choose to do this, Notepad opens up with ReadMe.txt inside (similar to opening a .txt file as people usually do).

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Ah, you mean the FAQ on running programs from within programs then.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    >> No, no, no
    No, you didn't check the FAQ, or no you think I misunderstood you?

    Here's the FAQ I was thinking of:

    http://faq.cprogramming.com/cgi-bin/...&id=1043284392

    The last option is probably your best bet, as you can pass it a document and let whatever application is setup to open that document open it.

  6. #6
    Not stupid, just stupider yaya's Avatar
    Join Date
    May 2007
    Location
    Earthland
    Posts
    204
    Ah! Thankyou very much.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Opening ASCII files in C?
    By Mavix in forum C Programming
    Replies: 6
    Last Post: 04-25-2007, 02:23 PM
  2. Need help opening a series of files
    By ramparts in forum C Programming
    Replies: 9
    Last Post: 11-14-2006, 05:49 PM
  3. Opening files with UNICODE file names
    By decohk in forum Linux Programming
    Replies: 2
    Last Post: 11-09-2006, 05:25 AM
  4. opening files
    By angelic79 in forum C Programming
    Replies: 3
    Last Post: 10-19-2004, 06:52 AM
  5. Opening files - Giving options?
    By wwwGazUKcom in forum C++ Programming
    Replies: 3
    Last Post: 09-18-2001, 07:06 AM