Re: Perl creates html-file, view from cmd.exe => Access is denied

2006-02-19 Thread Lennart Borgman

Igor Peshansky wrote:

Cygwin-created files are not executable unless they are explicitly created
with executable permissions on.  Perl doesn't do that, so you get a
non-executable HTML file (and can't run this from CMD).  ActiveState perl
lets Windows pick the file ACLs, which are usually based on directory
inheritance.  To simulate this in Cygwin, use "CYGWIN=nontsec perl
myscript.pl".

That said, you can also achieve the same effect (i.e., launching the
appropriate command for the file) by prepending "start" in cmd.exe or
"cygstart" in a Cygwin shell, no matter what the permissions are (i.e.,
use "start temp.html" or "cygstart temp.html").
HTH,
Igor
  

Just for the record: "start" in cmd.exe did not help.

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Perl creates html-file, view from cmd.exe => Access is denied

2006-02-15 Thread Lennart Borgman

Igor Peshansky wrote:

"perldoc -f chmod".
Igor
  

Yes, but it does not know the +x syntax.



Not that particular syntax (hey, you can always 'system("chmod +x $f")'),
but it does allow Fcntl constants (e.g., 'chmod
S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH $f' -- still from the above
perldoc page), and it uses the same octal mode values as the command-line
chmod (see "man chmod").  If you want to add the executable bits for
everyone, something like 'chmod 0111|((stat $f)[2]&0), $f' should
work.

None of this is Cygwin-specific.
Igor
  
Thanks, this is very useful for me in this context (and other times too 
I guess).


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Perl creates html-file, view from cmd.exe => Access is denied

2006-02-15 Thread Igor Peshansky
.  Redirected to the list.

On Wed, 15 Feb 2006, Lennart Borgman wrote:

> Igor Peshansky wrote:
> > > Thanks Dave, but what would "chmod +x" be in perl? Is there an easy
> > > way to do it? (Hope this is not too much OT, it is clearly useful
> > > here.)
> >
> > "perldoc -f chmod".
> > Igor
>
> Yes, but it does not know the +x syntax.

Not that particular syntax (hey, you can always 'system("chmod +x $f")'),
but it does allow Fcntl constants (e.g., 'chmod
S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH $f' -- still from the above
perldoc page), and it uses the same octal mode values as the command-line
chmod (see "man chmod").  If you want to add the executable bits for
everyone, something like 'chmod 0111|((stat $f)[2]&0), $f' should
work.

None of this is Cygwin-specific.
Igor
-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED] | [EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_Igor Peshansky, Ph.D. (name changed!)
 |,4-  ) )-,_. ,\ (  `'-'   old name: Igor Pechtchanski
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Perl creates html-file, view from cmd.exe => Access is denied

2006-02-15 Thread Igor Peshansky
On Wed, 15 Feb 2006, Lennart Borgman wrote:

> Dave Korn wrote:
> >   Or you can chmod +x it.  That's longer lasting! ;-)

For Dave: "achieve the same effect"..."no matter what the permissions are"
-- you can't, for example, launch a .html file from a bash shell at all.
"cygstart" will always work.

> >   Plus it could even be done as part of the perl script, and then the
> > problem would just /never/ arise again and wouldn't need to remember
> > to use 'start' or 'cygstart' to launch it.
>
> Thanks Dave, but what would "chmod +x" be in perl? Is there an easy way
> to do it? (Hope this is not too much OT, it is clearly useful here.)

"perldoc -f chmod".
Igor
-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED] | [EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_Igor Peshansky, Ph.D. (name changed!)
 |,4-  ) )-,_. ,\ (  `'-'   old name: Igor Pechtchanski
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Perl creates html-file, view from cmd.exe => Access is denied

2006-02-15 Thread Lennart Borgman

Dave Korn wrote:

  Or you can chmod +x it.  That's longer lasting! ;-)

  Plus it could even be done as part of the perl script, and then the problem
would just /never/ arise again and wouldn't need to remember to use 'start' or
'cygstart' to launch it.
  
Thanks Dave, but what would "chmod +x" be in perl? Is there an easy way 
to do it? (Hope this is not too much OT, it is clearly useful here.)


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



RE: Perl creates html-file, view from cmd.exe => Access is denied

2006-02-15 Thread Dave Korn
On 14 February 2006 23:12, Igor Peshansky wrote:

> On Tue, 14 Feb 2006, Lennart Borgman wrote:
> 
>> I use cygwin perl to create some html files from cygwin sh. When I then
>> later from cmd.exe (or cygwin sh) try to open one of these files from the
>> command line with 
>> 
>>temp.html
>> 
>> I get the error "Access denied". This does not happen if I use the same
>> trivial script from cmd.exe using ActiveState perl.
>> 
>> There seem to be some problems with the ACL list for the created file.
>> It looks to me like a cygwin bug. Below are more details.
> 
> It's not a bug, it's a feature. (tm)
> 
> Cygwin-created files are not executable unless they are explicitly created
> with executable permissions on.  Perl doesn't do that

> 
> That said, you can also achieve the same effect (i.e., launching the
> appropriate command for the file) by prepending "start" in cmd.exe or
> "cygstart" in a Cygwin shell, no matter what the permissions are (i.e.,
> use "start temp.html" or "cygstart temp.html").

  Or you can chmod +x it.  That's longer lasting! ;-)

  Plus it could even be done as part of the perl script, and then the problem
would just /never/ arise again and wouldn't need to remember to use 'start' or
'cygstart' to launch it.


cheers,
  DaveK
-- 
Can't think of a witty .sigline today


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Perl creates html-file, view from cmd.exe => Access is denied

2006-02-14 Thread Lennart Borgman

Igor Peshansky wrote:

On Tue, 14 Feb 2006, Lennart Borgman wrote:

  

I use cygwin perl to create some html files from cygwin sh. When I then
later from cmd.exe (or cygwin sh) try to open one of these files from
the command line with

   temp.html

I get the error "Access denied". This does not happen if I use the same
trivial script from cmd.exe using ActiveState perl.

There seem to be some problems with the ACL list for the created file.
It looks to me like a cygwin bug. Below are more details.



It's not a bug, it's a feature. (tm)

Cygwin-created files are not executable unless they are explicitly created
with executable permissions on.  Perl doesn't do that, so you get a
non-executable HTML file (and can't run this from CMD).  ActiveState perl
lets Windows pick the file ACLs, which are usually based on directory
inheritance.  To simulate this in Cygwin, use "CYGWIN=nontsec perl
myscript.pl".

That said, you can also achieve the same effect (i.e., launching the
appropriate command for the file) by prepending "start" in cmd.exe or
"cygstart" in a Cygwin shell, no matter what the permissions are (i.e.,
use "start temp.html" or "cygstart temp.html").
HTH,
Igor
  

Many thanks for the quick and good explanations!

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Perl creates html-file, view from cmd.exe => Access is denied

2006-02-14 Thread Igor Peshansky
On Tue, 14 Feb 2006, Lennart Borgman wrote:

> I use cygwin perl to create some html files from cygwin sh. When I then
> later from cmd.exe (or cygwin sh) try to open one of these files from
> the command line with
>
>temp.html
>
> I get the error "Access denied". This does not happen if I use the same
> trivial script from cmd.exe using ActiveState perl.
>
> There seem to be some problems with the ACL list for the created file.
> It looks to me like a cygwin bug. Below are more details.

It's not a bug, it's a feature. (tm)

Cygwin-created files are not executable unless they are explicitly created
with executable permissions on.  Perl doesn't do that, so you get a
non-executable HTML file (and can't run this from CMD).  ActiveState perl
lets Windows pick the file ACLs, which are usually based on directory
inheritance.  To simulate this in Cygwin, use "CYGWIN=nontsec perl
myscript.pl".

That said, you can also achieve the same effect (i.e., launching the
appropriate command for the file) by prepending "start" in cmd.exe or
"cygstart" in a Cygwin shell, no matter what the permissions are (i.e.,
use "start temp.html" or "cygstart temp.html").
HTH,
Igor
-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED] | [EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_Igor Peshansky, Ph.D. (name changed!)
 |,4-  ) )-,_. ,\ (  `'-'   old name: Igor Pechtchanski
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Perl creates html-file, view from cmd.exe => Access is denied

2006-02-14 Thread Lennart Borgman
I use cygwin perl to create some html files from cygwin sh. When I then 
later from cmd.exe (or cygwin sh) try to open one of these files from 
the command line with


   temp.html

I get the error "Access denied". This does not happen if I use the same 
trivial script from cmd.exe using ActiveState perl.


There seem to be some problems with the ACL list for the created file. 
It looks to me like a cygwin bug. Below are more details.


Kind regards,
Lennart

**
The perl script looks like this:

 use strict;
 open(OUT, ">temp.html") or die "Can't create temp.html: $!";
 print OUT qq[
   
 
   temp html file
 
 
   temp.html here!
 
   
 ];
 close(OUT);

The output from "cacls temp.html" is

D:\test\cygwin\temp.html W2ONE\Administrator:(special access:)
STANDARD_RIGHTS_ALL
DELETE
READ_CONTROL
WRITE_DAC
WRITE_OWNER
SYNCHRONIZE
STANDARD_RIGHTS_REQUIRED
FILE_GENERIC_READ
FILE_GENERIC_WRITE
FILE_READ_DATA
FILE_WRITE_DATA
FILE_APPEND_DATA
FILE_READ_EA
FILE_WRITE_EA
FILE_READ_ATTRIBUTES
FILE_WRITE_ATTRIBUTES

W2ONE\None:(special access:)
   READ_CONTROL
   SYNCHRONIZE
   FILE_GENERIC_READ
   FILE_READ_DATA
   FILE_READ_EA
   FILE_READ_ATTRIBUTES

Everyone:(special access:)
 READ_CONTROL
 SYNCHRONIZE
 FILE_GENERIC_READ
 FILE_READ_DATA
 FILE_READ_EA
 FILE_READ_ATTRIBUTES




--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/