# Read Text File action can't read files open by another process

**URL:** https://www.finalbuilder.com/forums/t/read-text-file-action-cant-read-files-open-by-another-process/1661
**Category:** Discussion
**Created:** [December 7, 2010, 3:28am UTC](https://www.finalbuilder.com/forums/t/read-text-file-action-cant-read-files-open-by-another-process/1661 "2010-12-07T03:28:17Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![gonyoda](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/gonyoda/32/119_2.png) [@gonyoda](https://www.finalbuilder.com/forums/u/gonyoda)
#### Post date: [December 7, 2010, 3:28am UTC](https://www.finalbuilder.com/forums/t/read-text-file-action-cant-read-files-open-by-another-process/1661/1 "2010-12-07T03:28:17Z")

</div>

The "Read Text File" action wants to open a file for generic read with no sharing. &nbsp;This means if the file is open for read by another process, the action will fail.&nbsp; Can you make it an option (or change it outright) so that the "Read Text File" action opens the file to allow read sharing?&nbsp; As it is, we have 90 seconds of retries in place waiting for the other process to close the handle so that FB can read the text content.&nbsp; This is not ideal.

A [post](https://www.finalbuilder.com/Default.aspx?tabid=456&aft=9018#9018) from last year indicates that the action was fixed, but apparently it isn't working like that any more.

Process monitor shows a SHARING&nbsp;VIOLATION&nbsp;error when attempting to open the file:  
Desired Access:&nbsp;Generic Read  
Disposition:&nbsp;Open  
Options:&nbsp;Synchronous IO Non-Alert, Non-Directory File  
Attributes:&nbsp;N  
**ShareMode:&nbsp;None**  
AllocationSize:&nbsp;n/a

Share Mode should probably be at least "Read" if not "Read, Write"

We are using FB&nbsp;v7.0.0.864.

Thanks,

John Gonyo

---

<div class="post-metadata">

### Author: ![paulsamways](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/e8c25b/32.png) [@paulsamways](https://www.finalbuilder.com/forums/u/paulsamways)
#### Post date: [December 7, 2010, 10:57am UTC](https://www.finalbuilder.com/forums/t/read-text-file-action-cant-read-files-open-by-another-process/1661/2 "2010-12-07T10:57:32Z")

</div>

Hi John,   
  
 I’ve updated the ‘Read Text File’ action to allow shared reading. I’ll let you know when a test build is available.   
  
 Regards,   
 Paul.

---

<div class="post-metadata">

### Author: ![paulsamways](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/e8c25b/32.png) [@paulsamways](https://www.finalbuilder.com/forums/u/paulsamways)
#### Post date: [December 8, 2010, 6:18am UTC](https://www.finalbuilder.com/forums/t/read-text-file-action-cant-read-files-open-by-another-process/1661/3 "2010-12-08T06:18:05Z")

</div>

Hi John,   
  
 Here is the new test build of FinalBuilder which has an option to allow shared reading of files.   
  
 URL: [https://www.finalbuilder.com/downloads/finalbuilder/aex6/FB700\_903.exe](https://www.finalbuilder.com/downloads/finalbuilder/aex6/FB700_903.exe)   
  
 Regards,   
 Paul.

---

<div class="post-metadata">

### Author: ![gonyoda](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/gonyoda/32/119_2.png) [@gonyoda](https://www.finalbuilder.com/forums/u/gonyoda)
#### Post date: [December 8, 2010, 4:45am UTC](https://www.finalbuilder.com/forums/t/read-text-file-action-cant-read-files-open-by-another-process/1661/4 "2010-12-08T04:45:03Z")

</div>

Thanks for the quick turn-around! However, we&nbsp;the new version (v903) created a new failure. &nbsp;It has an unexpected failure with pushing an item onto a Queue.

We define the queue (ActiveFolders) in the main action. &nbsp;Later, in an async action, we push items onto the queue. &nbsp;It seems to successfully push 20+ items onto the queue, then suddenly it fails stating:

```
List object not found: ActiveFolders
```

```
Let me know if you need more information. We had to roll back to v864. John
```

---

<div class="post-metadata">

### Author: ![paulsamways](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/e8c25b/32.png) [@paulsamways](https://www.finalbuilder.com/forums/u/paulsamways)
#### Post date: [December 9, 2010, 12:26pm UTC](https://www.finalbuilder.com/forums/t/read-text-file-action-cant-read-files-open-by-another-process/1661/5 "2010-12-09T12:26:31Z")

</div>

Hi John,   
  
 Thanks for reporting this problem, I’ve been trying to reproduce it here but haven’t had any luck. Are you able to send in a project to support [at] [finalbuilder.com](http://finalbuilder.com) which reproduces the bug you’re seeing?   
  
 Regards,   
 Paul.

---

<div class="post-metadata">

### Author: ![paulsamways](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/e8c25b/32.png) [@paulsamways](https://www.finalbuilder.com/forums/u/paulsamways)
#### Post date: [December 9, 2010, 1:30am UTC](https://www.finalbuilder.com/forums/t/read-text-file-action-cant-read-files-open-by-another-process/1661/6 "2010-12-09T01:30:02Z")

</div>

Hi John,   
  
Can you just confirm whether in you're project you are calling a Action List recursively with an ASync Group? This has been the only way so far to reproduce the error you're getting.   
  
For example:  
  
- Main Action List   
&nbsp;&nbsp;- Define Queue   
&nbsp;&nbsp;- Run Action List (List1)   
  
- List1 Action List   
&nbsp;&nbsp;- Push onto Queue   
&nbsp;&nbsp;- Run Action List (List 2)   
  
- List 2 Action List   
&nbsp;&nbsp;- Async Group   
&nbsp;&nbsp; &nbsp;- Run Action List (List 1)   
  
Regards,   
Paul.

---

<div class="post-metadata">

### Author: ![gonyoda](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/gonyoda/32/119_2.png) [@gonyoda](https://www.finalbuilder.com/forums/u/gonyoda)
#### Post date: [December 9, 2010, 7:27am UTC](https://www.finalbuilder.com/forums/t/read-text-file-action-cant-read-files-open-by-another-process/1661/7 "2010-12-09T07:27:33Z")

</div>

I looked closely at the project, it’s not recursive. I was unable to reproduce with a sample project. So I stripped the project down to the basics and was able to reproduce it. When I change the “main” project’s async action to synchronous, I don’t get the exception. I’m trying to isolate it in our project file so you can reproduce.   
  
 -john

---

<div class="post-metadata">

### Author: ![gonyoda](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/gonyoda/32/119_2.png) [@gonyoda](https://www.finalbuilder.com/forums/u/gonyoda)
#### Post date: [December 9, 2010, 8:45am UTC](https://www.finalbuilder.com/forums/t/read-text-file-action-cant-read-files-open-by-another-process/1661/8 "2010-12-09T08:45:14Z")

</div>

Try #2 (last post messed up):  
I trimmed our project down to the bare necessities to reproduce the failure. &nbsp;It occurs during "ASync - Stage Service Files By Machine" down inside 2-3 levels of action lists during the "Stage Service Files" action list. &nbsp;It doesn't happen every time, but most of the time.

Hopefully this can help you resolve the issue we're having.&nbsp;

Thanks!

John

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [December 13, 2010, 8:19am UTC](https://www.finalbuilder.com/forums/t/read-text-file-action-cant-read-files-open-by-another-process/1661/9 "2010-12-13T08:19:03Z")

</div>

Hi John   
  
 Please try this build, it should now work as expected. The issue was caused by code we added in the last update to deal with objects (such as queues, filesets, property sets, ftp connections etc) being defined in a cloned actionlist - when more than 1 instance of an actionlist is run at the same we clone the actionlist and run the cloned one(for re-entrance reasons). We have made some improvements to this over the last few days.   
  
 We created a bunch of new tests which showed the issue you were seeing in various scenarios, and found a few other failures too (although some were in somewhat contrived situations), all those tests are now passing so hopefully we have it sorted :   
  
 [https://www.finalbuilder.com/downloads/finalbuilder/aex6/FB700\_913.exe](https://www.finalbuilder.com/downloads/finalbuilder/aex6/FB700_913.exe)

---

<div class="post-metadata">

### Author: ![gonyoda](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/gonyoda/32/119_2.png) [@gonyoda](https://www.finalbuilder.com/forums/u/gonyoda)
#### Post date: [December 21, 2010, 2:19am UTC](https://www.finalbuilder.com/forums/t/read-text-file-action-cant-read-files-open-by-another-process/1661/10 "2010-12-21T02:19:51Z")

</div>

Vince,&nbsp;

We've been running build 913 for a week now and haven't seen any new issues crop up. &nbsp;The flag to toggle sharing on file reads works just great for us!

Thanks again,

John

---

<div class="post-metadata">

### Author: ![paulsamways](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/e8c25b/32.png) [@paulsamways](https://www.finalbuilder.com/forums/u/paulsamways)
#### Post date: [December 21, 2010, 10:24am UTC](https://www.finalbuilder.com/forums/t/read-text-file-action-cant-read-files-open-by-another-process/1661/11 "2010-12-21T10:24:35Z")

</div>

Hi John,   
  
 Thats great! Thanks for letting us know.   
  
 Regards,   
 Paul.
