Forum Discussion
FICO
7 years agoCommunity Manager
Permissions issue when writing lp file from mosel
We have an application written in C#, that runs a compiled Mosel model, running under Windows 10 that writes an lp file to a temporary folder. On the customer's installation machine we are receiving an IO_ERROR because Windows is blocking the compiled Mosel model from writing the file to the temporary folder. What XPRESS file needs to be given write permissions for the temporary folder?
4 Replies
- FICOCommunity Manager
Are you configuring any restrictions for the Mosel model execution? Otherwise the access rights will depend on the user who is running the process.
Would you mind sharing some further detail, in particular the statement that you are using for writing out the matrix file?
- FICOCommunity Manager
Hi Susan,
This is the statement
exportprob(0, TemplpFile, TotalRevenue)
TemplpFile is the path to the file. The folder part is picked up in C# as the user's default temporary folder and has a file name appended to it. The main application executable has no problems writing to the temp folder but the bim file does.
Many thanks,
Stewart
- FICOCommunity Manager
Before trying to write out the file this way, could you try to run some experiments by adding a few lines into your Mosel source:
1. Check whether the destination directory exists and is writeable (requires: uses "mmsystem"):
writeln(TemplpFile)
tdir:= pathsplit(SYS_DIR,TemplpFile)
writeln(tdir)
fstat:=getfstat(tdir)
if bittest(fstat, SYS_TYP)<>SYS_DIR
then writeln("tdir is not a directory")
end-if
if bittest(fstat, SYS_WRITE)<>SYS_WRITE
then writeln("tdir is not writeable")
end-if
2.Check whether Mosel's temporary directory can be used for writing the file:
tdir:=gettmpdir
writeln(tdir)
exportprob(0, string(tdir))
Mosel uses the user's temporary directory as its temporary directory, so you should be seeing some similar output from the second as what you get in the first case.
- FICOCommunity Manager
Thanks Susan,
Having asked the customer's IT Group to investigate further this seems to be general permissions problem. Another (non-Mosel) operation that involves a temporary file, and which I'd been informed was working, was in fact failing due to the same issue. I wasn't aware of the mmsystem features in the code above, they will prove useful!
Related Content
Related Content
Error 11 when writing results to a database.
I am trying to insert results into a sqlite database using the following: SQLexecute(" INSERT INTO res_rm_markets_oper (case_id, market, strat_node, oper_scenario, oper_period, bid_up, bid_down...1 year agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum2 unread comments2 unread1View0likes2CommentsVariable object mapping issue in Python Callbacks with Presolve enabled
Hi, I am implementing a Branch-and-Cut algorithm using the Xpress Python interface. I have structured my code as a class where I create variables (using xp.var) and store them in a dictionary attrib...9 months agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum6 unread comments6 unread6Views0likes6Comments