Cannot save/run GAMS file to/from mapped SharePoint network drive - sharepoint

I am trying to run a model in GAMS (using the Windows GAMS 64, version 24.5). The model .gms file is located on a Z drive that is mapped to a SharePoint folder. We use this setup all the time with other programming languages without problem. But when I try to run or save my model, I get the following error:
Unable to save file:
Z:\[my file path]\mymodel.gms
Error 123: The filename, directory name, or volume label syntax is incorrect
When I try to run the file, I also get the following message in the process window:
*** Error: Error writing GAMSNext: Invalid argument
Exit code = 113
SharePoint is really useful in tracking versions and letting the teams collaborate using a tool they are already familiar with (and our IT dept will not let us install git or similar). So I'd like to figure out how to get this to work, if possible, and why it is only a problem in GAMS.
Any insights? In particular, anyone know what the GAMSNext file that GAMS seems to be trying to write is? Also, why is GAMS perfectly able to save files to SharePoint when I create my project file (the .gpr file was, in fact, saved just fine), but not when I try to save a change to my .gms file? What is the difference in the GAMS save process for a .gms file and a .gpr file?

I have seen this issue before - GAMS not running a file on a network path/drive and give a 'UNC path error' or so.
If I recall, the issue was solved when we took the project file out of the "My Documents" folder. If it is a shared drive created for windows, you may have a "My Documents" folder which has a path with "Documents". Create your GAMS folder from the root and create your .gpj and .gms files there.
Hope this helps.

Related

Snakemake cannot write metadata

I have troubles to get snakemake-minimal=7.8.5 to run on Windows 10. I can execute rules, but snakemake terminates due to an error regarding the metadata:
Failed to set marker file for job started ([Errno 2] No such file or directory: 'C:\\test\\project\\.snakemake\\incomplete\\cnVucy9leHBlcmltZW50XzAzL2RmX2ludGVuc2l0aWVzX3Byb3RlaW5Hcm91cHNfbG9uZ18yMDE3XzIwMThfMjAxOV8yMDIwX04wNTAxNV9NMDQ1NDcvUV9FeGFjdGl2ZV9IRl9YX09yYml0cmFwX0V4YWN0aXZlX1Nlcmllc19zbG90XyM2MDcwLzE0X2V4cGVyaW1lbnRfMDNfZGF0YS5pcHluYg=='). Snakemake will work, but cannot ensure that output files are complete in case of a kill signal or power loss. Please ensure write permissions for the directory C:\test\project\.snakemake
I tried to troubleshoot doing the following
change the folders: Documents, User folder, and like the above in the root folder of my c drive
I tried to manipulate the security settings: Controlled folder or RandsomWare Access, see discussion -> it is deactivated
If I erase the .snakemake it is re-creating upon execution, so I assume I have write access. However, some security setting is disallowing the long filename with the hash
I tried the same workflow on a different Windows 10 machine and there I don't get the error, so I assume it is some windows issue.
Did anyone encounter the same error and found a solution?
I agree it is due to the length of the filename. It seems the default max filename length is 260. The file you pasted has a length of 262. You can edit the registry to allow longer filenames. Also consider opening an issue in snakemake to improve the documentation or otherwise address this issue for windows machines.

In Windows Node.js fs.readdirSync With Users Folders etc

I've been developing an nw.js project and use node.js file system functions in it as normal. In my application there is a file manager and I list folders and files according to user navigation. In Windows, for example, if I scan drive C: I get the Turkish named folder "Kullanıcılar" as "Users". I know it's real name in operating system is "Users" and just seen on the screen according to Languages. I can replace names of such folders when dispaying in my file manager but I'm searching for better solution if exists. Thanks in advance.
There's an SO answer here that reads the localized name of a folder in C# using the SHGetFileInfo function which might help you along.
Now I know you didn't ask, but in case you want to know where the information is stored... It's within the directory, in the Desktop.ini file.
For instance, my Windows 10 installation has this in it for "Users":
[.ShellClassInfo]
LocalizedResourceName=#%SystemRoot%\system32\shell32.dll,-21813
And this for the Images folder within my user folder (bringing this up to show you the additional keys):
[.ShellClassInfo]
LocalizedResourceName=#%SystemRoot%\system32\shell32.dll,-21779
InfoTip=#%SystemRoot%\system32\shell32.dll,-12688
IconResource=%SystemRoot%\system32\imageres.dll,-113
IconFile=%SystemRoot%\system32\shell32.dll
IconIndex=-236
The #%SystemRoot%\system32\shell32.dll,-21813 points to having to read the MUI (multilingual user interface) resources, key 21813 for the given file (presumably the # means that it's in this file, not this literal value, but don't quote me on that). %SystemRoot% is an environment variable that points to the Windows directory.
The actual MUI files and their locations are handled by Windows (see the MSDN link above), but we'll just happen to handily know that the MUI file for the US English localization of shell32.dll is system32\en-US\shell32.dll.mui.
Opening up that file with Resource Hacker, we can search for 21813 -- and voila! We can find STRINGTABLE resource #1364 that contains:
[...snip...]
21812, "Extras and Upgrades"
21813, "Users"
21814, "Saved Games"
[...snip...]
I unfortunately don't have tr-TR/shell32.dll.mui available, so you'll just have to trust me that you'd find the Kullanıcılar string there.

Finding and saving present directory of a SAS-Studio-program in a Linux server

I am trying to make a macro variable in SAS Studio which saves the "present working directory" as a macro variable.
The SAS-program is run in a "CPF" process flow file in SAS Studio, and the whole SAS-file and processes are saved and run in a Linux server.
In SAS-Studio, the location of CPF-process flow file seems like in the directory /sasdata/model_v1, and when I run a Linux command like X "pwd" then I expect that the result will give /sasdata/model_v1, but I get another directory instead like /sasinstall/sasconfig/Lev1/SASApp instead, I guess the the process flow file with CPF-suffix is run from this directory.
So the question is how I can find and save the working directory of my cpf-file and save as a macro-variable, or even maybe for my other sas-files too, I may need the solution for both SAS-files and CPF-files.
If I find the directory, then I guess it should be enough to save them as macro-variable by using %let macrovariable = "/directory"
I don't think SAS will show you the path of the process file. It doesn't in SAS/Studio 3.5.
It will set the path for a normal program file (as long as you have saved it) in the _SASPROGRAMFILE macro variable.

mcc -mv in linux machine R2013a

When I am trying to make executable files of my .m-files on a Linux machine, some of the the .m-files are working absolutely fine.
However, one file which has camera input inside the .m-file is giving me this error:
Depfun error: 'Unexpected Standard exception from MEX file. What() is: ..' Error using mcc Error executing mcc, return status = 1 (0x1).
But when I use the same .m-file on Windows and R2012a it is working properly without any error.
I found a bug report here - is this a similar problem?
How do I solve it?
Here is the simple code of my .m-file:
function yuv()
vid1 = videoinput('linuxvideo', 1, 'YUYV_1280x960');
set(vid1,'FramesPerTrigger',1);
start(vid1);
imageData1=getdata(vid1,1);
imageData=ycbcr2rgb(imageData1);
imagesc(imageData(:,:,:,1));
end
I was getting the same Depfun error, "What() is: ..", under R2013a on Linux but no errors when using a different OS or an older MATLAB version to compile my code. Following the bug report you linked to fixed it for me.
In the zip file linked to in the bug report you'll find a depfun.opts file. Rename or move your original depfun.opts file that's located in [matlabroot]/toolbox/compiler and copy the new one in its place.
Putting the new depfun.opts file in place is all it took for me to be able to compile using R2013a on Linux.
Also note, the bug report says that it could be caused by the importdata function or the Parallel Computing Toolbox but I'm not using either of those.

csrun loses executable from .csx package

I am having a hard time with a seemingly simple Azure program.
My exercise is to create WorkerRole that spawns "helloworld.exe"
- which does just that - prints "hello world" and exits.
I am using Visual Studio to create a project,
then added new folder to project solution "bin2" where I put hello.exe
using menu option "Add Existing Item".
then created local storage bin2 in ServiceDefinition.csdef:
so I can find my executable with RoleEnvironment:
string baseDir = RoleEnvironment.GetLocalResource("bin2").RootPath.Replace('\', '/');
string command = Path.Combine(baseDir, #"hello.exe");
then ran cspack.exe to create .csx directory.
Resulting .csx package got hello.exe in the correct location:
WorkerRole1.csx\roles\WorkerRole1\approot\bin2\hello.exe
then I started local development fabric with csrun.exe and get error from the parent process that bin2/hello.exe is missing.
Do I need to do something else to make csrun to copy hello.exe into "bin2".
Any ideas?
Thank you in advance,
Ivgard
I'm pretty sure I answered this question already (probably on the MSDN forum)? But the local resource you declare will give you a path entirely different from where you're putting your hello.exe. When you add the file to your project, it gets included with the rest of the code for your role. When you look up the local resource, you get a path to an empty directory which you can use to write and read data. Those two are completely separate and unrelated locations.
If you want to find your hello.exe that's under bin2, just look for the relative path, or use %RoleRoot%\approot\bin2 (or maybe it's %RoleRoot%\approot\bin\bin2?).

Resources