{"id":362,"date":"2016-02-23T13:58:18","date_gmt":"2016-02-23T13:58:18","guid":{"rendered":"http:\/\/zappysys.com\/blog\/?p=362"},"modified":"2016-02-23T16:15:49","modified_gmt":"2016-02-23T16:15:49","slug":"ssis-check-file-locked-wait-file-unlocked-c-script","status":"publish","type":"post","link":"https:\/\/zappysys.com\/blog\/ssis-check-file-locked-wait-file-unlocked-c-script\/","title":{"rendered":"SSIS check file is locked and wait until file is unlocked (C# Script)"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>In this small blog post you will learn How to move files using <a href=\"https:\/\/zappysys.com\/products\/ssis-powerpack\/ssis-file-system-task-advanced\/\">SSIS Advanced File System Task<\/a> and <i>How to wait until file is unlocked<\/i> using <strong>C# Script Task<\/strong>.<\/p>\n<h2>How to check if file is locked (SSIS C# Script Task)<\/h2>\n<p>If you want to check if file is locked in C# then below code will do the trick. But no worry if you dont know C#. ZappySys SSIS PowerPack comes with two tasks which can solve this issue without coding. You can use <a href=\"https:\/\/zappysys.com\/products\/ssis-powerpack\/ssis-file-system-task-advanced\/\">SSIS Advanced File System Task<\/a> with <strong>Get file lock status action<\/strong> or Use <a href=\"https:\/\/zappysys.com\/products\/ssis-powerpack\/ssis-validation-task\/\">SSIS Validation Task<\/a> which has option to throw error on lock condition or you can continue by saving lock status into variable and continue without throwing error. <\/p>\n<pre class=\"lang:default decode:true \" >\/\/ Attempt to open the file exclusively. -- If you get erro means file is locked\r\nusing (FileStream fs = new FileStream(fullPath,\r\n\tFileMode.Open, FileAccess.ReadWrite,\r\n\tFileShare.None, 100))\r\n{\r\n\tfs.ReadByte();\r\n\r\n\t\/\/ If we got this far the file is ready\r\n\tbreak;\r\n}<\/pre>\n<h2>How to wait until file is unlocked (SSIS C# Script Task)<\/h2>\n<p>Now lets check real example which will first check for locked file using <a href=\"https:\/\/zappysys.com\/products\/ssis-powerpack\/ssis-validation-task\/\">SSIS Validation Task<\/a> and then if file is locked then  wait until file is unlocked (with some timeout hardcoded in script). <\/p>\n<p>If specified wait time is reached then script will throw error. Once file is unlocked <a href=\"https:\/\/zappysys.com\/products\/ssis-powerpack\/ssis-file-system-task-advanced\/\">SSIS Advanced File System Task<\/a> will copy file to target.<\/p>\n<div id=\"attachment_368\" style=\"width: 563px\" class=\"wp-caption alignnone\"><a href=\"\/\/zappysys.com\/blog\/wp-content\/uploads\/2016\/02\/ssis-check-file-locked-wait-until-unlocked.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-368\" src=\"\/\/zappysys.com\/blog\/wp-content\/uploads\/2016\/02\/ssis-check-file-locked-wait-until-unlocked.png\" alt=\"SSIS - How to check if file is locked. Wait until file is unlocked (C# Code - SSIS Script Task).\" width=\"553\" height=\"458\" class=\"size-full wp-image-368\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2016\/02\/ssis-check-file-locked-wait-until-unlocked.png 553w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2016\/02\/ssis-check-file-locked-wait-until-unlocked-300x248.png 300w\" sizes=\"(max-width: 553px) 100vw, 553px\" \/><\/a><p id=\"caption-attachment-368\" class=\"wp-caption-text\">SSIS &#8211; How to check if file is locked. Wait until file is unlocked (C# Code &#8211; SSIS Script Task).<\/p><\/div>\n<h3>SSIS Validation Task -Store file lock status into variable<\/h3>\n<div id=\"attachment_367\" style=\"width: 550px\" class=\"wp-caption alignnone\"><a href=\"\/\/zappysys.com\/blog\/wp-content\/uploads\/2016\/02\/ssis-validation-task-check-if-file-is-locked.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-367\" src=\"\/\/zappysys.com\/blog\/wp-content\/uploads\/2016\/02\/ssis-validation-task-check-if-file-is-locked.png\" alt=\"SSIS Validation Task -Check if file is locked. Save status to variable or throw error.\" width=\"540\" height=\"567\" class=\"size-full wp-image-367\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2016\/02\/ssis-validation-task-check-if-file-is-locked.png 540w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2016\/02\/ssis-validation-task-check-if-file-is-locked-286x300.png 286w\" sizes=\"(max-width: 540px) 100vw, 540px\" \/><\/a><p id=\"caption-attachment-367\" class=\"wp-caption-text\">SSIS Validation Task -Check if file is locked. Save status to variable or throw error.<\/p><\/div>\n<h3>SSIS Advanced File System Task &#8211; Copy, Move, Rename, Delete multiple files<\/h3>\n<div id=\"attachment_366\" style=\"width: 711px\" class=\"wp-caption alignnone\"><a href=\"\/\/zappysys.com\/blog\/wp-content\/uploads\/2016\/02\/ssis-advanced-file-system-task-how-to-copy-move-files.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-366\" src=\"\/\/zappysys.com\/blog\/wp-content\/uploads\/2016\/02\/ssis-advanced-file-system-task-how-to-copy-move-files.png\" alt=\"SSIS Advanced File System Task. Copy, Move, Rename, Delete multiple files\" width=\"701\" height=\"559\" class=\"size-full wp-image-366\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2016\/02\/ssis-advanced-file-system-task-how-to-copy-move-files.png 701w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2016\/02\/ssis-advanced-file-system-task-how-to-copy-move-files-300x239.png 300w\" sizes=\"(max-width: 701px) 100vw, 701px\" \/><\/a><p id=\"caption-attachment-366\" class=\"wp-caption-text\">SSIS Advanced File System Task. Copy, Move, Rename, Delete multiple files<\/p><\/div>\n<h3>SSIS C# Script Task &#8211; Check file is locked, wait until file is unlocked<\/h3>\n<pre class=\"lang:c# decode:true \" >#region Namespaces\r\nusing System;\r\nusing System.Data;\r\nusing Microsoft.SqlServer.Dts.Runtime;\r\nusing System.Windows.Forms;\r\nusing System.IO;\r\n#endregion\r\n\r\nnamespace ST_334a75922c6a47a5b4ac21ee8e4e5fff\r\n{\r\n\t[Microsoft.SqlServer.Dts.Tasks.ScriptTask.SSISScriptTaskEntryPointAttribute]\r\n\tpublic partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase\r\n\t{\r\n\t\tpublic void Main()\r\n\t\t{\r\n\t\t\t\/\/ TODO: Add your code here\r\n            try\r\n            {\r\n                var file = Dts.Variables[\"User::filePath\"].Value.ToString();\r\n\r\n                bool continueIfFileMissing = false;\r\n                if (!System.IO.File.Exists(file))\r\n                {\r\n                    if (continueIfFileMissing)\r\n                    {\r\n                        Dts.TaskResult = (int)ScriptResults.Success;\r\n                        return;\r\n                    }\r\n                    LogError(\"File not found: \" + file);\r\n                    Dts.TaskResult = (int)ScriptResults.Failure;\r\n                }\r\n                    \r\n                WaitForFile(file, maxWaitInSec:30);\r\n                Dts.TaskResult = (int)ScriptResults.Success;\r\n            }\r\n            catch (Exception ex)\r\n            {\r\n                LogError(ex.Message);\r\n                Dts.TaskResult = (int)ScriptResults.Failure;\r\n            }           \r\n\t\t\t\r\n\t\t}\r\n        \/\/\/ &lt;summary&gt;\r\n        \/\/\/ Blocks until the file is not locked any more.\r\n        \/\/\/ &lt;\/summary&gt;\r\n        \/\/\/ &lt;param name=\"fullPath\"&gt;&lt;\/param&gt;\r\n        bool WaitForFile(string fullPath,int maxWaitInSec)\r\n        {\r\n            int numTries = 0;\r\n            while (true)\r\n            {\r\n                ++numTries;\r\n                try\r\n                {\r\n                    \/\/ Attempt to open the file exclusively.\r\n                    using (FileStream fs = new FileStream(fullPath,\r\n                        FileMode.Open, FileAccess.ReadWrite,\r\n                        FileShare.None, 100))\r\n                    {\r\n                        fs.ReadByte();\r\n\r\n                        \/\/ If we got this far the file is ready\r\n                        break;\r\n                    }\r\n                }\r\n                catch (Exception ex)\r\n                {\r\n                   if(numTries==1 ||  numTries % 20 ==0 )\r\n                      LogWarning(string.Format(\"WaitForFile {0} failed to get an exclusive lock: {1}\",fullPath, ex.Message));\r\n\r\n                    \/\/if (numTries &gt; 10)\r\n                    \/\/{\r\n                    \/\/    LogWarning(string.Format(\r\n                    \/\/        \"WaitForFile {0} giving up after 10 tries\",\r\n                    \/\/        fullPath));\r\n                    \/\/    return false;\r\n                    \/\/}\r\n\r\n                   if (numTries &gt;= maxWaitInSec * 2)\r\n                   {\r\n                       throw new Exception(\"Max wait time reached for file : \" + fullPath + \". Waited for \" + maxWaitInSec + \" seconds but lock not released\");\r\n                   }\r\n\r\n                    \/\/ Wait for the lock to be released\r\n                    System.Threading.Thread.Sleep(500);\r\n                }\r\n\r\n                \r\n            }\r\n\r\n            LogInformation( string.Format( \"WaitForFile {0} returning true after {1} tries\",fullPath, numTries));\r\n            return true;\r\n        }\r\n\r\n        private void LogInformation(string msg)\r\n        {\r\n            bool again = false;\r\n            Dts.Events.FireInformation(0, \"ScriptTask\", msg, \"\", 0,ref again);\r\n        }\r\n        \r\n        private void LogError(string msg)\r\n        {\r\n            Dts.Events.FireError(0, \"ScriptTask\", msg, \"\", 0);\r\n        }\r\n        private void LogWarning(string msg)\r\n        {\r\n            Dts.Events.FireWarning(0, \"ScriptTask\", msg, \"\", 0);\r\n        }\r\n        #region ScriptResults declaration\r\n        \/\/\/ &lt;summary&gt;\r\n        \/\/\/ This enum provides a convenient shorthand within the scope of this class for setting the\r\n        \/\/\/ result of the script.\r\n        \/\/\/ \r\n        \/\/\/ This code was generated automatically.\r\n        \/\/\/ &lt;\/summary&gt;\r\n        enum ScriptResults\r\n        {\r\n            Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,\r\n            Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure\r\n        };\r\n        #endregion\r\n\r\n\t}\r\n}<\/pre>\n<h2>Download Sample Package<\/h2>\n<p>Below sample will work only if you have <a href=\"https:\/\/zappysys.com\/products\/ssis-powerpack\/\">SSIS PowerPack<\/a> Installed. Download it <a href=\"https:\/\/zappysys.com\/products\/ssis-powerpack\/download\/\">from here<\/a> it will take only 1 minute to install<br \/>\n<a href=\"\/\/zappysys.com\/downloads\/files\/ssis\/2012\/AdvancedFileSystemTask_Copy_Locked.zip\">Download SSIS 2012 &#8211; Sample Package (Process Locked file)<\/a><\/p>\n<h2>Conclusion<\/h2>\n<p>Processing and detecting locked files in SSIS can be tricky but using small C# script it can save you some headache. Download <a href=\"https:\/\/zappysys.com\/products\/ssis-powerpack\/ssis-file-system-task-advanced\/\">Advanced File System Task<\/a> to try many options not available in native File System Task.<\/p>\n<p>Other Keywords:<br \/>\n<i>Check locked files in SSIS<\/i><br \/>\n<i>How to check whether file is locked or not in SSIS<\/i><br \/>\n<i>Detect locked file in SSIS<\/i><br \/>\n<i>Wait until file is unlocked using C# script<\/i><br \/>\n<i>How to handle file locking issue in SSIS using C# script<\/i><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In this small blog post you will learn How to move files using SSIS Advanced File System Task and How to wait until file is unlocked using C# Script Task. How to check if file is locked (SSIS C# Script Task) If you want to check if file is locked in C# then below [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":368,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[47],"tags":[37,38,12,79,4,78],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\r\n<title>SSIS check file is locked and wait until file is unlocked (C# Script) | ZappySys Blog<\/title>\r\n<meta name=\"description\" content=\"Learn how to check for locked file and wait until file is unlocked in SSIS using C# Script Task. Use Advanced File System Task to detect File Locking.\" \/>\r\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\r\n<link rel=\"canonical\" href=\"https:\/\/zappysys.com\/blog\/ssis-check-file-locked-wait-file-unlocked-c-script\/\" \/>\r\n<meta property=\"og:locale\" content=\"en_US\" \/>\r\n<meta property=\"og:type\" content=\"article\" \/>\r\n<meta property=\"og:title\" content=\"SSIS check file is locked and wait until file is unlocked (C# Script) | ZappySys Blog\" \/>\r\n<meta property=\"og:description\" content=\"Learn how to check for locked file and wait until file is unlocked in SSIS using C# Script Task. Use Advanced File System Task to detect File Locking.\" \/>\r\n<meta property=\"og:url\" content=\"https:\/\/zappysys.com\/blog\/ssis-check-file-locked-wait-file-unlocked-c-script\/\" \/>\r\n<meta property=\"og:site_name\" content=\"ZappySys Blog\" \/>\r\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/ZappySys\/\" \/>\r\n<meta property=\"article:published_time\" content=\"2016-02-23T13:58:18+00:00\" \/>\r\n<meta property=\"article:modified_time\" content=\"2016-02-23T16:15:49+00:00\" \/>\r\n<meta property=\"og:image\" content=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2016\/02\/ssis-check-file-locked-wait-until-unlocked.png\" \/>\r\n\t<meta property=\"og:image:width\" content=\"553\" \/>\r\n\t<meta property=\"og:image:height\" content=\"458\" \/>\r\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\r\n<meta name=\"author\" content=\"ZappySys\" \/>\r\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\r\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/zappysys\/\" \/>\r\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"ZappySys\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\r\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/zappysys.com\/blog\/ssis-check-file-locked-wait-file-unlocked-c-script\/\",\"url\":\"https:\/\/zappysys.com\/blog\/ssis-check-file-locked-wait-file-unlocked-c-script\/\",\"name\":\"SSIS check file is locked and wait until file is unlocked (C# Script) | ZappySys Blog\",\"isPartOf\":{\"@id\":\"https:\/\/zappysys.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/zappysys.com\/blog\/ssis-check-file-locked-wait-file-unlocked-c-script\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/zappysys.com\/blog\/ssis-check-file-locked-wait-file-unlocked-c-script\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2016\/02\/ssis-check-file-locked-wait-until-unlocked.png\",\"datePublished\":\"2016-02-23T13:58:18+00:00\",\"dateModified\":\"2016-02-23T16:15:49+00:00\",\"author\":{\"@id\":\"https:\/\/zappysys.com\/blog\/#\/schema\/person\/2756c237457fbc95d82cb38962f81f82\"},\"description\":\"Learn how to check for locked file and wait until file is unlocked in SSIS using C# Script Task. Use Advanced File System Task to detect File Locking.\",\"breadcrumb\":{\"@id\":\"https:\/\/zappysys.com\/blog\/ssis-check-file-locked-wait-file-unlocked-c-script\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/zappysys.com\/blog\/ssis-check-file-locked-wait-file-unlocked-c-script\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/zappysys.com\/blog\/ssis-check-file-locked-wait-file-unlocked-c-script\/#primaryimage\",\"url\":\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2016\/02\/ssis-check-file-locked-wait-until-unlocked.png\",\"contentUrl\":\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2016\/02\/ssis-check-file-locked-wait-until-unlocked.png\",\"width\":553,\"height\":458,\"caption\":\"SSIS - How to check if file is locked. Wait until file is unlocked (C# Code - SSIS Script Task).\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/zappysys.com\/blog\/ssis-check-file-locked-wait-file-unlocked-c-script\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/zappysys.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SSIS check file is locked and wait until file is unlocked (C# Script)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/zappysys.com\/blog\/#website\",\"url\":\"https:\/\/zappysys.com\/blog\/\",\"name\":\"ZappySys Blog\",\"description\":\"SSIS \/ ODBC Drivers \/ API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/zappysys.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/zappysys.com\/blog\/#\/schema\/person\/2756c237457fbc95d82cb38962f81f82\",\"name\":\"ZappySys\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/zappysys.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5c9be148088ba9b8af8e955c5f7c22b5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5c9be148088ba9b8af8e955c5f7c22b5?s=96&d=mm&r=g\",\"caption\":\"ZappySys\"},\"sameAs\":[\"http:\/\/www.zappysys.com\/\",\"https:\/\/www.facebook.com\/ZappySys\/\",\"https:\/\/twitter.com\/https:\/\/twitter.com\/zappysys\/\"],\"url\":\"https:\/\/zappysys.com\/blog\/author\/admin\/\"}]}<\/script>\r\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SSIS check file is locked and wait until file is unlocked (C# Script) | ZappySys Blog","description":"Learn how to check for locked file and wait until file is unlocked in SSIS using C# Script Task. Use Advanced File System Task to detect File Locking.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/zappysys.com\/blog\/ssis-check-file-locked-wait-file-unlocked-c-script\/","og_locale":"en_US","og_type":"article","og_title":"SSIS check file is locked and wait until file is unlocked (C# Script) | ZappySys Blog","og_description":"Learn how to check for locked file and wait until file is unlocked in SSIS using C# Script Task. Use Advanced File System Task to detect File Locking.","og_url":"https:\/\/zappysys.com\/blog\/ssis-check-file-locked-wait-file-unlocked-c-script\/","og_site_name":"ZappySys Blog","article_author":"https:\/\/www.facebook.com\/ZappySys\/","article_published_time":"2016-02-23T13:58:18+00:00","article_modified_time":"2016-02-23T16:15:49+00:00","og_image":[{"width":553,"height":458,"url":"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2016\/02\/ssis-check-file-locked-wait-until-unlocked.png","type":"image\/png"}],"author":"ZappySys","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/zappysys\/","twitter_misc":{"Written by":"ZappySys","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/zappysys.com\/blog\/ssis-check-file-locked-wait-file-unlocked-c-script\/","url":"https:\/\/zappysys.com\/blog\/ssis-check-file-locked-wait-file-unlocked-c-script\/","name":"SSIS check file is locked and wait until file is unlocked (C# Script) | ZappySys Blog","isPartOf":{"@id":"https:\/\/zappysys.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/zappysys.com\/blog\/ssis-check-file-locked-wait-file-unlocked-c-script\/#primaryimage"},"image":{"@id":"https:\/\/zappysys.com\/blog\/ssis-check-file-locked-wait-file-unlocked-c-script\/#primaryimage"},"thumbnailUrl":"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2016\/02\/ssis-check-file-locked-wait-until-unlocked.png","datePublished":"2016-02-23T13:58:18+00:00","dateModified":"2016-02-23T16:15:49+00:00","author":{"@id":"https:\/\/zappysys.com\/blog\/#\/schema\/person\/2756c237457fbc95d82cb38962f81f82"},"description":"Learn how to check for locked file and wait until file is unlocked in SSIS using C# Script Task. Use Advanced File System Task to detect File Locking.","breadcrumb":{"@id":"https:\/\/zappysys.com\/blog\/ssis-check-file-locked-wait-file-unlocked-c-script\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/zappysys.com\/blog\/ssis-check-file-locked-wait-file-unlocked-c-script\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/zappysys.com\/blog\/ssis-check-file-locked-wait-file-unlocked-c-script\/#primaryimage","url":"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2016\/02\/ssis-check-file-locked-wait-until-unlocked.png","contentUrl":"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2016\/02\/ssis-check-file-locked-wait-until-unlocked.png","width":553,"height":458,"caption":"SSIS - How to check if file is locked. Wait until file is unlocked (C# Code - SSIS Script Task)."},{"@type":"BreadcrumbList","@id":"https:\/\/zappysys.com\/blog\/ssis-check-file-locked-wait-file-unlocked-c-script\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/zappysys.com\/blog\/"},{"@type":"ListItem","position":2,"name":"SSIS check file is locked and wait until file is unlocked (C# Script)"}]},{"@type":"WebSite","@id":"https:\/\/zappysys.com\/blog\/#website","url":"https:\/\/zappysys.com\/blog\/","name":"ZappySys Blog","description":"SSIS \/ ODBC Drivers \/ API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/zappysys.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/zappysys.com\/blog\/#\/schema\/person\/2756c237457fbc95d82cb38962f81f82","name":"ZappySys","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/zappysys.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/5c9be148088ba9b8af8e955c5f7c22b5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5c9be148088ba9b8af8e955c5f7c22b5?s=96&d=mm&r=g","caption":"ZappySys"},"sameAs":["http:\/\/www.zappysys.com\/","https:\/\/www.facebook.com\/ZappySys\/","https:\/\/twitter.com\/https:\/\/twitter.com\/zappysys\/"],"url":"https:\/\/zappysys.com\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/posts\/362"}],"collection":[{"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/comments?post=362"}],"version-history":[{"count":0,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/posts\/362\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/media\/368"}],"wp:attachment":[{"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/media?parent=362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/categories?post=362"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/tags?post=362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}