On a offtopic note(well for the list at least)

perl -e "print chmod 0777 'test.txt'"
on ntfs
works under cygwin
but fails under strawberry.

Is this true of other win32 dists?
I dont have activestate loaded at the moment.

This isnt really important because I worked around the problem by using Win32::FileSecurity and setting the ntfs acl directly.

So here is the test:

C:\scripts>cat > test.txt
^Z

C:\scripts>cacls test.txt
C:\scripts\test.txt BUILTIN\Administrators:F
                    NT AUTHORITY\SYSTEM:F
                    DAVISRS\bob:F
                    BUILTIN\Users:R

C:\scripts>perl -e "print chmod 0777, 'test.txt'"
1

C:\scripts>cacls test.txt
C:\scripts\test.txt BUILTIN\Administrators:F
                    NT AUTHORITY\SYSTEM:F
                    DAVISRS\bob:F
                    BUILTIN\Users:R

---------------------------
So no change. Now the cygwin chmod:

[EMAIL PROTECTED]/c/scripts$ perl -e "print chmod 0777, 'test.txt'"
1

[EMAIL PROTECTED]/c/scripts$ cacls test.txt
c:\scripts\test.txt DAVISRS\bob:(special access:)
                                STANDARD_RIGHTS_ALL
                                DELETE
                                READ_CONTROL
                                WRITE_DAC
                                WRITE_OWNER
                                SYNCHRONIZE
                                STANDARD_RIGHTS_REQUIRED
                                FILE_GENERIC_READ
                                FILE_GENERIC_WRITE
                                FILE_GENERIC_EXECUTE
                                FILE_READ_DATA
                                FILE_WRITE_DATA
                                FILE_APPEND_DATA
                                FILE_READ_EA
                                FILE_WRITE_EA
                                FILE_EXECUTE
                                FILE_READ_ATTRIBUTES
                                FILE_WRITE_ATTRIBUTES

                    DAVISRS\None:(special access:)
                                 READ_CONTROL
                                 SYNCHRONIZE
                                 FILE_GENERIC_READ
                                 FILE_GENERIC_WRITE
                                 FILE_GENERIC_EXECUTE
                                 FILE_READ_DATA
                                 FILE_WRITE_DATA
                                 FILE_APPEND_DATA
                                 FILE_READ_EA
                                 FILE_WRITE_EA
                                 FILE_EXECUTE
                                 FILE_READ_ATTRIBUTES
                                 FILE_WRITE_ATTRIBUTES

                    Everyone:(special access:)
                             READ_CONTROL
                             SYNCHRONIZE
                             FILE_GENERIC_READ
                             FILE_GENERIC_WRITE
                             FILE_GENERIC_EXECUTE
                             FILE_READ_DATA
                             FILE_WRITE_DATA
                             FILE_APPEND_DATA
                             FILE_READ_EA
                             FILE_WRITE_EA
                             FILE_EXECUTE
                             FILE_READ_ATTRIBUTES
                             FILE_WRITE_ATTRIBUTES

                    BUILTIN\Administrators:F
                    NT AUTHORITY\SYSTEM:F
                    BUILTIN\Users:R


[EMAIL PROTECTED]/c/scripts$ ls -l test.txt
-rwxrwxrwx+ 1 bob None 0 May 29 00:27 test.txt
-------------------------
Also the cygwin ls -l for good measure.

It looks like cygwin perl uses the mode handling of cygwin which basically does what you want which is to allow other people access to your files. Other people are like the local system account which all services run under.

bob

Reply via email to