How to Write the Read-only file in java?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • leninbecse
    New Member
    • Aug 2010
    • 15

    #1

    How to Write the Read-only file in java?

    How to Write the Read-only file in java?
  • Dheeraj Joshi
    Recognized Expert Top Contributor
    • Jul 2009
    • 1129

    #2
    You can not write the read-only file, since it is read-only and you can write if you have appropriate file permissions.

    Regards
    Dheeraj Joshi

    Comment

    • Nepomuk
      Recognized Expert Specialist
      • Aug 2007
      • 3111

      #3
      Or do you want to create a file in Java, that is read-only?

      Greetings,
      Nepomuk

      Comment

      • Oralloy
        Recognized Expert Contributor
        • Jun 2010
        • 988

        #4
        If you need to manipulate the file using system commands, look at the java.lang.Runti me class.

        Also, there is a setWritable method that you might want to explore in the java.io.File class.

        Try writing something, and we'll help you through it.

        Good Luck!

        Comment

        Working...