#!/usr/bin/perl

#This is a perl script to fix the fact that windows writes
#xlm files with a \ when we must have / for firefox which
#also works for iexplorer

#$last=readpipe("cat xmlfix.log");
#$current=readpipe("date +%s");

#system("find /home2 -mmin -59 -name *.xml -print > xmlfix.log");
#system("find /home2 -name *.xml -print > xmlfix.log");
system("updatedb");
system("locate .xml | grep public_html > xmlfix.log");

open(RECORD, "xmlfix.log");

#system ("echo 's/\\\\/\\//g' > testme");

#print "hello this is a \\ this a /, thankyou";
 
while(<RECORD>){
   @info = split (/\s+/);
   $file=$info[0];
   chomp($file);
   #print $file;
   #print $file;
   system("cp $file /BACKUPXML");
   system("sed 's/\\\\/\\//g' $file > temp.dat");
   system("cp -f temp.dat $file");
}
