This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Giving File Permission

 
Koh Khai Huat
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I am creating a game applet and the game is done. When my game finish i need to write a string "WIN" to a text file. I got the filewriter done alr but when i was writing the string the program it gave me a error "File Access Denined" it says that the file access "write" permission is not granted.

I would like to ask if any of u guys know how to allow the file access "write" i am open to all suggestion and advice thanks in advance

regards
KKH
 
Vinayak patil
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Have a look at the FilePermission Class (java.io.FilePermission)

This may help.

-Vinayak
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are using a Unix system, right ?
You should make sure that the output directory is writtable for the user.
(using chmod may help)
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If this is an applet, it is being executed on the client and not the server. So you would have to set up a network connection to write data to the server. If you want to save data on the client, you will have to sign the applet.
 
Koh Khai Huat
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

i am running on Windows

regards
KKH
 
Vinayak patil
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i am running on Windows


Check the file properties and ensure that the "Read Only" checkbox is not checked.


-Vinayak
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And read carefully what Keith Lynn said. You cannot write to the client machine from an applet without some permission (a real pain)
 
Koh Khai Huat
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys,

i double check the file is not in "read only" and i indent to let my applet able to write on any pc that run's it. (it is a real pain!!!)

and until now i still dun know how to use file permission dose anyone of u know any examples that i can take a look thx its hard to understand man!!

regards
KKH
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic