WordPress database error: [INSERT, UPDATE command denied to user '51213-2'@'10.10.20.57' for table 'wp_options']INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`) VALUES ('_transient_doing_cron', '1714811561.1646690368652343750000', 'yes') ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`)
Sometimes you need to check the existence of a file. Nothing is easier with the .Net framework which provide a property named Exists on FileInfo class. <\/p>\n
But it can be quite long, especially when the file is on a network drive.<\/strong> If so you’ll have to wait for a time-out to know that the file is not reachable.<\/p>\n This was too slow for me so I coded this little utility which performs the same but with a customizable TimeOut. As it may interest you, here it is: Enjoy !<\/p>\n","protected":false},"excerpt":{"rendered":" Sometimes you need to check the existence of a file. Nothing is easier with the .Net framework which provide a property named Exists on FileInfo class. But it can be quite long, especially when the…<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[18,15],"_links":{"self":[{"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/posts\/87"}],"collection":[{"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/comments?post=87"}],"version-history":[{"count":13,"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/posts\/87\/revisions"}],"predecessor-version":[{"id":100,"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/posts\/87\/revisions\/100"}],"wp:attachment":[{"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/media?parent=87"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/categories?post=87"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/tags?post=87"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}
\n[csharp]private static bool VerifyFileExists(Uri uri, int timeout)
\n{
\n var task = new Task<bool>(() =>
\n {
\n var fi = new FileInfo(uri.LocalPath);
\n return fi.Exists;
\n });
\n task.Start();
\n return task.Wait(timeout) && task.Result;
\n}
\n[\/csharp]<\/p>\n