chmod 600 equivalent for MS Windows

Mark Taylor m.b.taylor at bristol.ac.uk
Mon Jul 14 08:18:39 PDT 2008


If there's anyone out there who knows about Microsoft Windows,

(I'm hoping Luigi might, since he was able to answer about %USERPROFILE%)

I'm writing Java code which should ensure that the .samp lockfile
cannot be read by anyone other than the owner of that file.
Although there is a method

    java.io.File.setReadable()

in Java which can do the trick, it is only available from Java 1.6,
and I'd like to provide a fallback for earlier JVMs.

On Un*x I can call out to the OS and invoke a command like:

    Runtime.exec( new String[] { "chmod", "600", filename } );

Does anybody know if this is possible for some/any/all versions of
MS Windows, and if so, how I should phrase the command?

thanks

Mark

-- 
Mark Taylor   Astronomical Programmer   Physics, Bristol University, UK
m.b.taylor at bris.ac.uk +44-117-928-8776 http://www.star.bris.ac.uk/~mbt/



More information about the apps-samp mailing list