Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

mySQL+java delete permissions

Options
  • 19-02-2004 3:59pm
    #1
    Closed Accounts Posts: 175 ✭✭


    OK, this one is wrecking my head here.

    I'm using mySQL with a java GUI. what i did was create a file using my SQL and now i want to delete it. I used java's file.delete() which works grand in Windows but when i tried run it on Linux i wasn't allowed. I have su access but everyone using this program wont.

    Anyone know how i can delete or overwrite this file from a normal user point of view?


    thanks in advance.


Comments

  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    I'm looking for a way to do this under 100% Pure Java, but can't find a way myself... The only thing I can think of is to write a shell script that takes the files path as an argument and changes the permissions. You can call this using Runtime.exec()

    Alternatively, if you wanted to play with JNDI you could try calling the JNDI File System Service (http://java.sun.com/products/jndi/serviceproviders.html), though I never played with that one myself and I'm not sure what it can do...


  • Registered Users Posts: 19,396 ✭✭✭✭Karoma


    run app and sql as same group ... or chmod (script) for the file? messy..


  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    Better still (just found this), apply FilePermissions to the file, then delete as normal...

    There had to be a better way...


  • Closed Accounts Posts: 175 ✭✭bdiddy


    cheers, gonna try a cupla them ideas out in the next version, just gonna put a message up for the user on this one.
    Slainte!


Advertisement