{"id":7505,"date":"2017-09-01T11:35:44","date_gmt":"2017-09-01T18:35:44","guid":{"rendered":"http:\/\/www.yuleshow.com\/?p=7505"},"modified":"2017-09-01T11:35:44","modified_gmt":"2017-09-01T18:35:44","slug":"a-quick-dirty-job-to-synchronize-picasa-folders-through-icloud","status":"publish","type":"post","link":"https:\/\/www.yuleshow.com\/?p=7505","title":{"rendered":"A quick dirty job to synchronize Picasa folders through iCloud"},"content":{"rendered":"<p>I use Picasa a lot even Google stopped developing it. \u00a0I put the Picasa folder on Desktop so it can be replicated by iCloud which makes that I can have the same files and folders on both office and home mac. \u00a0Recently, I found that the modification I made on one mac can&#8217;t be synchronized to another, and vice versa.<br \/>\nThe issue is that Picasa does not REALLY modify the picture, it put the modification in a hidden file called .picasa.ini\u00a0under every folder, which won&#8217;t be replicated by iCloud. \u00a0The solution is to create a none hidden file I named\u00a0picasa.ini\u00a0duplicated from .picasa.ini\u00a0, then delete the original .picasa then create a symbol link .picasa.ini to picasa.ini .<br \/>\nThe following Perl code does the batch job, a quick dirty one. \u00a0It will test the folder to see whether .picasa.ini exists, once it has .picasa.ini\u00a0means it&#8217;s a Picasa folder. \u00a0Then it tests the picasa.ini\u00a0file, it will duplicate .picasa.ini\u00a0once it doesn&#8217;t exist. \u00a0Then do the following jobs.<\/p>\n<pre>#!\/usr\/bin\/perl\n$dir_to_process = \".\";\nopendir DIR, $dir_to_process\n    or die \"Cannot open $dir_to_process: $!\";\nforeach $file (readdir DIR) {\n    if (-d $file) {\n        print \"$file  is a directory\\n\";\n        $file_dot=\".picasa.ini\";\n        $file_nodot=\"picasa.ini\";\n        opendir PICASA, $file;\n        foreach $ffile (readdir PICASA) {\n            if ($ffile eq  $file_dot) {\n                print \".picasa.ini found in $file\\n\";\n                $mark_dot_picasa = 1;\n                if (-l $file.\"\/\".$ffile) {\n                    print \".picasa.ini is already a symbol link.\\n\";\n                    $mark_islink = 1;\n           } else {\n                    print \".picasa.ini isn't a symbol link, need to do something.\\n\";\n                }\n                if ($ffile eq $file_nodot) {\n                    print \"picasa.ini found in $file\\n\";\n           $mark_nodot_picasa=1;\n                }\n          }\n   }\n        if (($mark_nodot_picasa) &amp;&amp; ($mark_islink)) {\n            print \"This folder was already processed.\\n\";\n            print \"Nothing need to be touched.\\n\\n\";\n        }\n        if (!$mark_dot_picasa) {\n            print \"This is not a picasa folder.\\n\\n\";\n        }\n        $_ = $file;\n        ~s\/\\'\/\\\\\\'\/g;\n        ~s\/\\ \/\\\\\\ \/g;\n        ~s\/\\&amp;\/\\\\\\&amp;\/g;\n        ~s\/\\@\/\\\\\\@\/g;\n        $file = $_;\n        if (($mark_dot_picasa)&amp;&amp;(!($mark_islink))) {\n            if (!($mark_nodot_picasa)) {\n                print \"Move .picasa.ini to picasa.ini\\n\";\n                system (\"cp $file\/.picasa.ini $file\/picasa.ini.backup\");\n                system (\"mv $file\/.picasa.ini $file\/picasa.ini\");\n                print \".picasa is backup.\\n\";\n                print \"Created picasa.ini.\\n\";\n            } else {\n                system (\"rm $file\/.picasa.ini\");\n                print \"picasa.ini already exists, just remove none symbol link .picasa.ini.\";\n            }\n            system (\"ln -s picasa.ini $file\/.picasa.ini\");\n            print \"Symbol linked .picasa to picasa.ini.\\n\";\n        }\n    }\n    if (($mark_dot_picasa)&amp;&amp;($mark_nodot_picasa)&amp;&amp;(!($mark_islink)))  {\n        print \".picasa.ini and picasa.ini exist and .picasa is not a symbol link, delete .picasa.ini and create link.\\n\";\n    }\n    $mark_dot_picasa = 0;\n    $mark_nodot_picasa = 0;\n    $mark_islink = 0;\n    print \"\\n\";\n    closedir PICASA;\n}\nclosedir DIR;\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I use Picasa a lot even Google stopped developing it. \u00a0I put the Picasa folder on Desktop so it can be replicated by iCloud which makes that I can have the same files and folders on both office and home mac. \u00a0Recently, I found that the modification I made on one mac can&#8217;t be synchronized [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[47],"tags":[],"class_list":["post-7505","post","type-post","status-publish","format-standard","hentry","category-perl"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.yuleshow.com\/index.php?rest_route=\/wp\/v2\/posts\/7505","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yuleshow.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yuleshow.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yuleshow.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yuleshow.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7505"}],"version-history":[{"count":0,"href":"https:\/\/www.yuleshow.com\/index.php?rest_route=\/wp\/v2\/posts\/7505\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yuleshow.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7505"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yuleshow.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7505"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yuleshow.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7505"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}