Appologies if this is a duplicate.  I didn't recieve acknowledgement of my
first send, nor have I recieved that message from the list.

A couple days ago I asked for some help with a refresh loop which monitors a
telnet pipe, and maintaining the ability to input commands without a pause.

Is Term::ReadKey the solution to this?  I've read that it *could* be,
however in any implimentation I've tried to use it doesn't quite work.  Any
help to get this thing working would be greatly appreciated.

Here are the two primary meathods I've tried and thier setbacks.  BTW in
each example I have tried modes 0-5 for ReadMode.

First attempt does a great job monitoring the pipe, it cleanly monitors the
pipe and refreshes the screen.  Two issues, the first, I run OUT OF MEMORY
and of course the LOGIC IS BAD >=0 will always yield a TRUE result, hence
never accepting input.

use Term::ReadKey;

<----SNIP!---->

sub refresh
{
        $hosttxt=$host->getline;
        if (length($hosttxt) >= 0)
        {
        print "$hosttxt";
        $hosttxt=-1;
        &refresh;
        }
        ReadMode 0;
        chop($input=<STDIN>);
        $host->print("$input");
        &refresh;
}

The next attempt fixes the logic, however it still STOPS REFRESHING while
waiting for input and I still run OUT OF MEMORY.

use Term::ReadKey;

<----SNIP!---->

sub refresh
{
        $hosttxt=$host->getline;
        if (length($hosttxt) > 0)
        {
        print "$hosttxt";
        $hosttxt=-1;
        &refresh;
        }
        ReadMode 0;
        chop($input=<STDIN>);
        $host->print("$input");
        &refresh;
}

Thanks again,

D-

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
Dean Theophilou
Sent: Thursday, August 16, 2001 1:38 PM
To: Hemant Daya; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Win32-Perm - Question


Hello:

        Well that's different.  I'm going to have to look into that (knowing more
than one way to do something is important).  Thanks for the tip.

Dean Theophilou
Genisar


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
Hemant Daya
Sent: Wednesday, August 15, 2001 10:26 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: Win32-Perm - Question


Hi All,
and here is my two cents worth...
This is a piece of code I am using to do a similar thing.
I had to use the hex values for the permissions otherwise it showed up as
special access. This is for change control on the directory and the file.

sub addperms
# Add the NT permissions to the directory
{
        $permpath = "\\\\" . "$servername" . "\\" . "home" . "\\" . "$userid";
        $hmedir = new Win32::Perms( "dir:$permpath") || die "\nOops Can't find path
for perms:$!";
        $hmedir->Dump;
        $hmedir->Remove('users');
        $hmedir->Add("$userid", 0xe0010000, ALLOW, FILE);
        $hmedir->Add("$userid", 0x001301bf, ALLOW, DIRECTORY);
        $hmedir->Dump;
        $hmedir->Set();

}

Regards,
Hemant

>From: "Dean Theophilou" <[EMAIL PROTECTED]>
>To: "Thomas Schmidt" <[EMAIL PROTECTED]>,
>"[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
>Subject: RE: Win32-Perm - Question
>Date: Wed, 15 Aug 2001 13:37:23 -0700
>
>Hi Thomas:
>
>       Here is code snippet from one of my scripts that sets the NTFS permissions
>on a user's HOME directory to (RX)(RX) for the user, while removing a group
>that I didn't want to have access:
>
>$Path = 'dir:' . "\\\\Server\\Home\\$UserName";
>
>$PermDirFlag = DIRECTORY;
>$PermDirMask = READ | EXECUTE;
>
>$PermFileFlag = FILE;
>$PermFileMask = READ | EXECUTE;
>
>$HomeDir = new Win32::Perms($Path) ||
>       warn "Cannot create new permissions object: $!\n";
>
># this sets the user's directory permissions
>$HomeDir->Allow($UserName, $PermDirMask, $PermDirFlag);
>
># this sets the user's file permissions within the above directory
>$HomeDir->Allow($UserName, $PermFileMask, $PermFileFlag);
>
># this removes a group's permissions
>$HomeDir->Remove("Group"); # only the user should have access.
>
># this applies the above permissions to the object
>$HomeDir->Set();
>
>
>       I make no claims about the elegance (or lack, thereof) of this code, but,
>hey, it works. :)  Also, since I'm new to Perl, my explanations my not be
>100% technically correct.  Nevertheless, like I said, the above code works
>for me.  I hope this helps.
>
>
>Dean Theophilou
>Genisar
>
>-----Original Message-----
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED]]On Behalf Of
>Thomas Schmidt
>Sent: Wednesday, August 15, 2001 4:55 AM
>To: [EMAIL PROTECTED]
>Subject: Win32-Perm - Question
>
>
>Hello,
>
>I am triing to set File- and Directory-Permissions with Dave Roth�s
>Win32::Perm - Module. The following script sets an ACL to the file
>test.txt correctly.
>But the sript dont�t work with the directory "c:/temp".
>The ReadMe file says, that I have to use a Prefix with the directorys
>path, but I dont know the correct way.
>
>Thanks for your help.
>Thomas
>
>
>
>use Win32::Perms;
>
>  $File = new Win32::Perms;    # Create empty ACL�s
>  $Dir  = new Win32::Perms;
>
>  $File->Add({Account=>'co', Mask=>READ});     # Add an account to the
>ACL
>  $File->Set("c:/tmp-rechte/test.txt");                         # Set the
>file's permissions
>
>
># the files ACLs are modified correctly
>  $Dir->Add({Account=>'co', Mask=>READ});
>  $Dir->Set("c:/temp");
>
># the directories ACLs are not modified
>
>
>
>
>_______________________________________________
>Perl-Win32-Admin mailing list
>[EMAIL PROTECTED]
>http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin
>
>_______________________________________________
>Perl-Win32-Admin mailing list
>[EMAIL PROTECTED]
>http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin

_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin

_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin

Reply via email to