rovf has asked for the wisdom of the Perl Monks concerning the following question:

I fear this is more a Windows question than a perl question, but maybe someone can still help me...

My app runs on Windows and creates files on a netdrive, which is actually a Samba share on a Unix system. To make working with Samba easy, the Windows user name and the Unix user name are identical; no password authentification is needed.

When I log into the Unix account to look at the files created in that way, they have permission 0600. If my app explicitly does a chmod 0666, the permissions as seen from the Unix side are still 0600 (but chmod returns "1", signalling that the permissions have been changed in the correct way). Not being very proficient on Windows, my wild guess is that the Perl on Windows doesn't know anything about Unix permissions.

Is there any chance that I can set the permissions on that file, or do I simply have to accept that this can't be done?

-- 
Ronald Fischer <ynnor@mm.st>
  • Comment on chmod in Windows on Samba Drive: Can this be done at all?

Replies are listed 'Best First'.
Re: chmod in Windows on Samba Drive: Can this be done at all?
by Bloodnok (Vicar) on Oct 01, 2008 at 10:22 UTC
    Hi ,

    AFAIR, neither chmod(1) or chown(1) work over a network - the command has to be issued at the server end in order for them to be updated as you'd expect.

    HTH ,

    A user level that continues to overstate my experience :-))

      They don't even work locally, because Windows has a far finer grained-yet-different concept of file permissions than chmod.

      The only way to change the mode on the Unix side of things is to configure Samba to use a different umask or to issue the command remotely.