tar and open files

Christopher Faylor cgf-no-personal-reply-please@cygwin.com
Sat Feb 21 00:10:00 GMT 2004


On Fri, Feb 20, 2004 at 03:45:14PM -0800, Brian Dessent wrote:
>"DePriest, Jason R." wrote:
>> 
>> For a DLL, does just unregistering the DLL do what you need?  I mean,
>> running 'regsvr32 /u <dll>', put new file in place, run 'regsvr32
>> <dll>'?
>
>No.  The replacement only occurs at boot-time.
>
>I don't know if this is quite off-topic or not but I wrote the following
>perl script which reads the list of Pending File Rename Operations (to
>occur at next boot time) and outputs a shell script to perform them. 

If it is off-topic, I'll grant it a special dispensation for showing an
interesting technique.

I had no idea you could do this.

Thanks for sharing it with us.  I think I can use this.

cgf

>
>#!/usr/bin/perl -w
>
>use Win32::TieRegistry;
>
>my $pr =
>$Registry->{'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
>Manager\PendingFileRenameOperations'};
>
>my @list = split('\0', $pr);
>
>print "# ", join("\n# ", @list), "\n";
>
>while (@list) {
>  my $a = shift @list;
>  my $b = shift @list;
>  
>  if ($b) {
>    print "mv -f " . fix($a) . " " . fix($b) . "\n";
>  } else {
>    print "rm " . fix($a) . "\n";
>  }
>}
>        
>sub fix
>{
>  my $in = shift;
>  
>  $in =~ s%^\!?\\\?\?\\%%;
>  my $foo = quotemeta($in);
>  chomp (my $bar = `cygpath -u $foo`);
>  return "\'$bar\'";
>}
>
>--
>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/

--
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/



More information about the Cygwin mailing list