# Opening file "matpower/case30.m": No such file or directory

**URL:** <https://discourse.julialang.org/t/opening-file-matpower-case30-m-no-such-file-or-directory/46237>\
**Category:** General Usage\
**Tags:** question\
**Created:** [September 8, 2020, 4:00am UTC](https://discourse.julialang.org/t/opening-file-matpower-case30-m-no-such-file-or-directory/46237 "2020-09-08T04:00:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zlq178](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zlq178/32/17952_2.png) [@zlq178](https://discourse.julialang.org/u/zlq178)\
**Post date:** [September 8, 2020, 4:00am UTC](https://discourse.julialang.org/t/opening-file-matpower-case30-m-no-such-file-or-directory/46237/1 "2020-09-08T04:00:50Z")

</div>

‘’’  
##code  
using PowerModels  
using Ipopt

result=run\_ac\_opf(“matpower/case30.m”, with\_optimizer(Ipopt.Optimizer))  
‘’’  
errors:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/4/7/47f9ce0e60e4b061bd5a992735bfe54bdcf408db.png)  
question:How could I add all files about “matpower/caseXX.m”?The document has said the format is similar to matpower’s data,but I don’t know how to add it ?

---

<div class="post-metadata">

**Author:** ![stillyslalom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stillyslalom/32/45687_2.png) [@stillyslalom](https://discourse.julialang.org/u/stillyslalom)\
**Post date:** [September 8, 2020, 4:09am UTC](https://discourse.julialang.org/t/opening-file-matpower-case30-m-no-such-file-or-directory/46237/2 "2020-09-08T04:09:00Z")

</div>

Check the working directory of your Julia process with `pwd()`. If it’s not the directory containing `matpower/`, you’ll need to either use `joinpath("path/to/matpower", "case30.m")`for full filename paths, or `cd("path/to/matpower")` to change the working directory.

---

<div class="post-metadata">

**Author:** ![zlq178](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zlq178/32/17952_2.png) [@zlq178](https://discourse.julialang.org/u/zlq178)\
**Post date:** [September 8, 2020, 7:50am UTC](https://discourse.julialang.org/t/opening-file-matpower-case30-m-no-such-file-or-directory/46237/3 "2020-09-08T07:50:50Z")

</div>

‘’’  
using PowerModels  
using Ipopt  
joinpath(“path/to/matpower”, “case30.m”)  
result=run\_ac\_opf(“matpower/case30.m”, with\_optimizer(Ipopt.Optimizer))  
‘’’  
Is this code ? But repl show the same erro.:  
ERROR: SystemError: opening file “matpower/case30.m”: No such file or directory

If I do next one.

julia\> cd(“path/to/matpower”)  
ERROR: IOError: chdir path/to/matpower: no such file or directory (ENOENT)

Could you tell me how to solve it in detail?

---

<div class="post-metadata">

**Author:** ![ccoffrin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ccoffrin/32/400_2.png) [@ccoffrin](https://discourse.julialang.org/u/ccoffrin)\
**Post date:** [November 6, 2020, 4:44pm UTC](https://discourse.julialang.org/t/opening-file-matpower-case30-m-no-such-file-or-directory/46237/4 "2020-11-06T16:44:54Z")

</div>

In the example you have it should be, something like,

```julia
file_path = joinpath(“path/to/matpower”, “case30.m”)
result = run_ac_opf(file_path, Ipopt.Optimizer)

```

---

<div class="post-metadata">

**Author:** ![BYS](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bys/32/25384_2.png) [@BYS](https://discourse.julialang.org/u/BYS)\
**Post date:** [May 1, 2021, 10:40am UTC](https://discourse.julialang.org/t/opening-file-matpower-case30-m-no-such-file-or-directory/46237/5 "2021-05-01T10:40:29Z")

</div>

First,thank you very much for the platform of PowerModels,

I have encountered the same problem,If I write  
"  
file\_path = joinpath(“path/to/matpower”, “case30.m”)  
result = run\_ac\_opf(file\_path, Ipopt.Optimizer)  
"  
It seems to be  
"  
julia\> file\_path = joinpath(“path/to/matpower”, “case30.m”)  
“path/to/matpower\case30.m”  
julia\> result = run\_ac\_opf(file\_path, Ipopt.Optimizer)  
ERROR: SystemError: opening file “path/to/matpower\case30.m”: No such file or directory  
"  
I tried to change this ,and write this instead  
"  
file\_path=joinpath(“D:\Matlab2019\_64bit\bin\matpower7.0”,“case39.m”)  
result = run\_ac\_opf(file\_path, Ipopt.Optimizer)  
"  
But it tell me  
"  
julia\> file\_path=joinpath(“D:\Matlab2019\_64bit\bin\matpower7.0”,“case39.m”)  
ERROR: syntax: invalid escape sequence  
"  
How can I do it to use PowerModels?

---

<div class="post-metadata">

**Author:** ![BYS](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bys/32/25384_2.png) [@BYS](https://discourse.julialang.org/u/BYS)\
**Post date:** [May 1, 2021, 1:43pm UTC](https://discourse.julialang.org/t/opening-file-matpower-case30-m-no-such-file-or-directory/46237/6 "2021-05-01T13:43:20Z")

</div>

I have solved it. If someone has the same problem.Please find this,  
[https://docs.julialang.org/en/v1/base/file/](https://docs.julialang.org/en/v1/base/file/)
