Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

OS question

  1. Jan 13, 2005 #1
    Modern operating systems are file oriented, so in Windows you can access documents just by double clicking them without having to worry about opening the program. But I don't know how this is achieved. Is is done entirely by the OS or does the application program itself play a role? So suppose I want to develop a simple text editor that reads .txt files. Then if I specify that a .txt file be opened with that editor, will the latter be able automatically to deal with this request, or do I have to write special code for it?
  2. jcsd
  3. Jan 13, 2005 #2
    What do you mean by "OS" there are different layers of the OS, opening a file via the GUI uses a few... Anyway I think your assumtion is correct, as long as you associated your program with the .txt files within the OS then every time you open an .txt file your application or .exe will open it
  4. Jan 13, 2005 #3
    You don't have to write any code to get Windows to run your program for .txt files, just set the file association. But all Windows does is run your program with the .txt filename as a command-line parameter. You still have to open the file yourself.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook