locked
How to edit a file?

    Question

  • May be this is a foolish question. 

     There are such things as write (create) a file and append to the file. But how to edit data in a file in JS windows app?

    For example, I've set up a text file to gather inputs from a user. Later we want to edit some of this data. So what are options for these?

    Friday, May 24, 2013 7:12 PM

All replies

  • SonalMac -

    I believe these are the actions that you want to do:

    • Make initial write to inputsFile.
    • Read inputsFile to gather current data
    • Write to inputsFile to make modifications

    If this is so, take a look at:

    WinJS.Application.IOHelper object
    http://msdn.microsoft.com/en-us/library/windows/apps/br211764.aspx

    Friday, May 24, 2013 7:28 PM
  • Hi,

    Check out this code sample from MSDN code gallery. tells how to create/read/write to a file.

    It has sample code all operations that you can do with a file.

    Hope this helps..

    - Girija


    Friday, May 24, 2013 9:00 PM
  •   Thanks for reply.

     What does it mean to write and read BYTES into file? And Write and Read a file using a STREAM? code sample is good but I don't know these basics to understand those code sample. Please any explanation regarding this is appreciated.

    Friday, May 24, 2013 11:01 PM