WordPress database error: [INSERT, UPDATE command denied to user '51213-2'@'10.10.20.81' for table 'wp_options']
INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`) VALUES ('_transient_doing_cron', '1715215307.3684620857238769531250', 'yes') ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`)


Warning: Cannot modify header information - headers already sent by (output started at /home/lexiqued/www/WordPress/wp-includes/wp-db.php:1502) in /home/lexiqued/www/WordPress/wp-includes/feed-rss2.php on line 8
performance – Jonathan ANTOINE's thoughts http://www.jonathanantoine.com Yet another blog about... Thu, 18 Aug 2011 16:52:48 +0000 en-US hourly 1 https://wordpress.org/?v=5.5.3 Do you want a faster File.Exists / FileInfo.Exists / Directory.Exists ? I do ! http://www.jonathanantoine.com/2011/08/18/faster-file-exists/ http://www.jonathanantoine.com/2011/08/18/faster-file-exists/#comments Thu, 18 Aug 2011 16:10:21 +0000 http://www.jonathanantoine.com/?p=87 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 file is on a network drive. If so you’ll have to wait for a time-out to know that the file is not reachable.

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:
[csharp]private static bool VerifyFileExists(Uri uri, int timeout)
{
var task = new Task<bool>(() =>
{
var fi = new FileInfo(uri.LocalPath);
return fi.Exists;
});
task.Start();
return task.Wait(timeout) && task.Result;
}
[/csharp]

Enjoy !

]]>
http://www.jonathanantoine.com/2011/08/18/faster-file-exists/feed/ 4