in reply to Re: Perl Permissions
in thread Perl Permissions

I put that line in mycode but it just goes past it and gives' me the same error:
Permission denied at temp.pl line 20
Does this mean i do have permission do change its permissions. I dont see how i have to contact the admin as this is MY computer nobody uses it except me :/ so i'm really confused why i dont just have permission to do everything with everything.

Replies are listed 'Best First'.
Re^3: Perl Permissions
by Joost (Canon) on Dec 03, 2006 at 14:02 UTC
    Permission denied at temp.pl line 20
    You know, it would be very helpful if you provided a complete program (as short as possible!) that does only the chmod & open of one file and nothing else. Also provide the list of owners & permissions for the file in question and the directory it's in.

    i'm really confused why i dont just have permission to do everything with everything.
    Probably because the sysadmin doesn't have the time to fix all those installations that get completely scrambled when users are allowed to do anything and everything to it.

      #!/usr/bin/perl use Win32::Process::Info; #Requests to use the +Win32 Mod use Date::EzDate; #Requests to use the +date mod use File::Copy; my $printinfo = Win32::Process::Info->new(); #Gets the system proc +ess info my @info = $printinfo->GetProcInfo(); #Stored to an array my $currentdate = Date::EzDate->new(); #Loads the current Da +te an Time # #Manageing Log Files Chronologically # $hour = 2; until ($hour > 26) #Loop to r +ead all log files { opendir(LOGS, "/perl/ass/")|| die "dir not found"; #Opens the + folder containing the days log files @logfiles = readdir(LOGS); #Puts the +name of all files into an array closedir(LOGS); $currentlog = "/perl/ass/@logfiles[$hour]"; chmod (0777, $currentlog) or die "Can't change permissions: $!"; + #Gives everyone all permissions on all fi +les in the folder open(CURRENTLOG, $currentlog)|| die "file not found: $!"; $firstline = <CURRENTLOG>; $date = substr($firstline,0 ,2); $hour++; }
      I can't give you a list of owner's and permissions as i'm working in windows and do not know the commands sorry.
      http://img.photobucket.com/albums/v230/blundell/errorperl.jpg
        To determine what process is holding a lock on the files you are trying to access, you might look at Process Explorer.

        Your problem is really more a system/file problem than a Perl issue.

        Since this is Win32, you might want to report $^E (in addition to $!), as it can have a more specific or more detailed explanation than what $! provides in some situations (and this sounds like one of those).

        - tye