OK, if you're running IIS and the site is password protected, then forget everything I said about the IUSR_MACHINE_NAME user :-)

First of all, make sure you have a group that all the users are in ('Domain Users' will do). Then, give that group 'Full control' on the directory where you store the files. If that's not enough, then try adding this to your script...

chmod(0666, $filename)

... after you create the file. (Note that 0666 is an octal number, you need the leading zero and don't put it in quotes). The 'chmod' function is really a unixy thing but if it does what you need then it's a simple solution.

If 'chmod' doesn't do it, then you can use the Win32::FileSecurity module that comes with ActivePerl. This is adapted from the man page:

use Win32::FileSecurity qw(Get Set MakeMask); my %hash; $perms = MakeMask( qw( FULL ) ); Get( $filename, \%hash ) ; $hash{$group_name} = $perms; Set( $filename, \%hash ) ;

good luck


In reply to Re: Re: Re: Re: Re: Re: Unlink on NT by grantm
in thread Unlink on NT by strikr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.