# Search path of staload

**URL:** <https://discourse.ats-lang.org/t/search-path-of-staload/427>\
**Category:** Google Group\
**Created:** [December 19, 2013, 6:23pm UTC](https://discourse.ats-lang.org/t/search-path-of-staload/427 "2013-12-19T18:23:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zhiqiang\_Ren](https://avatars.discourse-cdn.com/v4/letter/z/9fc29f/32.png) [@Zhiqiang\_Ren](https://discourse.ats-lang.org/u/Zhiqiang_Ren)\
**Post date:** [December 19, 2013, 6:23pm UTC](https://discourse.ats-lang.org/t/search-path-of-staload/427/1 "2013-12-19T18:23:53Z")

</div>

For ATS-Postiats, if I invoke patsopt in a directory different from the one  
which contains the files,  
staload “sys\_model.sats” will not lead to the location of the .sats file  
even if it’s along side with the .dats file. I have to write the following  
in the .dats file.  
staload “./sys\_model.sats”

What’s the main principle of locating files inside patsopt? Thanks.

---

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [December 19, 2013, 6:39pm UTC](https://discourse.ats-lang.org/t/search-path-of-staload/427/2 "2013-12-19T18:39:55Z")

</div>

Say you have

staload “./foo.sats”

in the file ‘bar.dats’. Then the “.” means the directory in which  
‘bar.dats’ is stored.

If you use

staload “foo.sats”

then patsopt searches for ‘foo.sats’ using include-path (-IATS).

In your case, my guess is that the directory containing ‘sys-model.sats’  
was not on the include-path for patsopt.On Thursday, December 19, 2013 1:23:53 PM UTC-5, Zhiqiang Ren wrote:

> For ATS-Postiats, if I invoke patsopt in a directory different from the  
> one which contains the files,  
> staload “sys\_model.sats” will not lead to the location of the .sats file  
> even if it’s along side with the .dats file. I have to write the following  
> in the .dats file.  
> staload “./sys\_model.sats”
> 
> What’s the main principle of locating files inside patsopt? Thanks.

---

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [December 19, 2013, 7:04pm UTC](https://discourse.ats-lang.org/t/search-path-of-staload/427/3 "2013-12-19T19:04:24Z")

</div>

Yes.On Thursday, December 19, 2013 2:01:46 PM UTC-5, Zhiqiang Ren wrote:

> Can I assume that whenever there is “./xxx/xxx”, the file is located from  
> the position of the current file containing the staload and the path  
> specified by -IATS is not used at all?
> 
> On Thursday, December 19, 2013 1:39:55 PM UTC-5, gmhwxi wrote:
> 
> > Say you have
> > 
> > staload "./foo.sats"Yes
> > 
> > in the file ‘bar.dats’. Then the “.” means the directory in which  
> > ‘bar.dats’ is stored.
> > 
> > If you use
> > 
> > staload “foo.sats”
> > 
> > then patsopt searches for ‘foo.sats’ using include-path (-IATS).
> > 
> > In your case, my guess is that the directory containing ‘sys-model.sats’  
> > was not on the include-path for patsopt.
> > 
> > On Thursday, December 19, 2013 1:23:53 PM UTC-5, Zhiqiang Ren wrote:
> > 
> > > For ATS-Postiats, if I invoke patsopt in a directory different from the  
> > > one which contains the files,  
> > > staload “sys\_model.sats” will not lead to the location of the .sats file  
> > > even if it’s along side with the .dats file. I have to write the following  
> > > in the .dats file.  
> > > staload “./sys\_model.sats”
> > > 
> > > What’s the main principle of locating files inside patsopt? Thanks.

---

<div class="post-metadata">

**Author:** ![Zhiqiang\_Ren](https://avatars.discourse-cdn.com/v4/letter/z/9fc29f/32.png) [@Zhiqiang\_Ren](https://discourse.ats-lang.org/u/Zhiqiang_Ren)\
**Post date:** [December 19, 2013, 7:01pm UTC](https://discourse.ats-lang.org/t/search-path-of-staload/427/4 "2013-12-19T19:01:46Z")

</div>

Can I assume that whenever there is “./xxx/xxx”, the file is located from  
the position of the current file containing the staload and the path  
specified by -IATS is not used at all?On Thursday, December 19, 2013 1:39:55 PM UTC-5, gmhwxi wrote:

> Say you have
> 
> staload “./foo.sats”
> 
> in the file ‘bar.dats’. Then the “.” means the directory in which  
> ‘bar.dats’ is stored.
> 
> If you use
> 
> staload “foo.sats”
> 
> then patsopt searches for ‘foo.sats’ using include-path (-IATS).
> 
> In your case, my guess is that the directory containing ‘sys-model.sats’  
> was not on the include-path for patsopt.
> 
> On Thursday, December 19, 2013 1:23:53 PM UTC-5, Zhiqiang Ren wrote:
> 
> > For ATS-Postiats, if I invoke patsopt in a directory different from the  
> > one which contains the files,  
> > staload “sys\_model.sats” will not lead to the location of the .sats file  
> > even if it’s along side with the .dats file. I have to write the following  
> > in the .dats file.  
> > staload “./sys\_model.sats”
> > 
> > What’s the main principle of locating files inside patsopt? Thanks.
