chmod 600 equivalent for MS Windows

Bruno Rino brino at eso.org
Mon Jul 14 09:18:49 PDT 2008


hum... maybe I should read my mails better.

What you're looking for should this command:
CACLS filename /G %USERNAME%:F

Note that this kind of permissions can only be set on NTFS (i.e. it 
cannot be set on FAT filesystems).

Cheers,
Bruno


On 14/07/2008 17:21, Bruno Rino wrote:
> on a windows command prompt,
>
> attrib -R filename
>
> does the trick
>
> Cheers,
> Bruno
>
> On 14/07/2008 17:18, Mark Taylor wrote:
>> 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
>>
>
>



More information about the apps-samp mailing list