# DOpus crash using FSUtil.ReadDir() with path in lib:// format

**URL:** https://resource.dopus.com/t/dopus-crash-using-fsutil-readdir-with-path-in-lib-format/30641
**Category:** Help & Support
**Created:** [December 2, 2018, 1:02am UTC](https://resource.dopus.com/t/dopus-crash-using-fsutil-readdir-with-path-in-lib-format/30641 "2018-12-02T01:02:14Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![OddCosine](https://resource.dopus.com/letter_avatar_proxy/v4/letter/o/e0b2c6/32.png) [@OddCosine](https://resource.dopus.com/u/OddCosine)
#### Post date: [December 2, 2018, 1:02am UTC](https://resource.dopus.com/t/dopus-crash-using-fsutil-readdir-with-path-in-lib-format/30641/1 "2018-12-02T01:02:14Z")

</div>

Beginning in version 12.10, it appears that using a path in the lib:// format with FSUtil.ReadDir() will cause DOpus to crash. I think it actually crashes on the resulting FolderEnum's Next() command.

Paste the following code into the CLI Script Editor, select JScript as the language and make sure the path specified in the 'base' variable is valid. Run the code and DOpus should crash.

```auto
var base = "lib://Foo/";
var fsutil = DOpus.FSUtil;
var items = fsutil.ReadDir( base, false );
var item;

while ( !items.complete ) {
   item = items.next();
   DOpus.Output( item.name );
}
```

The workaround I have found is to use the FSutil.Resolve() command on the path.

```auto
var items = fsutil.ReadDir( fsutil.resolve(base), false );
```

This code is a simplified case of some code from my scripts, which worked through 12.9, but crashes 12.10 (including beta 3).

---

<div class="post-metadata">

### Author: ![Jon](https://resource.dopus.com/user_avatar/resource.dopus.com/jon/32/12713_2.png) [@Jon](https://resource.dopus.com/u/Jon)
#### Post date: [December 2, 2018, 1:40am UTC](https://resource.dopus.com/t/dopus-crash-using-fsutil-readdir-with-path-in-lib-format/30641/2 "2018-12-02T01:40:33Z")

</div>

Confirmed, sorry about that! We'll get it fixed in the next update.

---

<div class="post-metadata">

### Author: ![OddCosine](https://resource.dopus.com/letter_avatar_proxy/v4/letter/o/e0b2c6/32.png) [@OddCosine](https://resource.dopus.com/u/OddCosine)
#### Post date: [December 2, 2018, 7:58am UTC](https://resource.dopus.com/t/dopus-crash-using-fsutil-readdir-with-path-in-lib-format/30641/3 "2018-12-02T07:58:50Z")

</div>

Good news, thanks for looking at this.

---

<div class="post-metadata">

### Author: ![Jon](https://resource.dopus.com/user_avatar/resource.dopus.com/jon/32/12713_2.png) [@Jon](https://resource.dopus.com/u/Jon)
#### Post date: [December 5, 2018, 3:37am UTC](https://resource.dopus.com/t/dopus-crash-using-fsutil-readdir-with-path-in-lib-format/30641/4 "2018-12-05T03:37:18Z")

</div>

The fix for this is in the new [12.10.4 Beta](https://resource.dopus.com/t/directory-opus-12-10-4-beta/30667).
