How do I give a compiled MATLAB script permission to operate on server folders?

2 ビュー (過去 30 日間)
Benjamin
Benjamin 2014 年 9 月 15 日
コメント済み: Image Analyst 2014 年 9 月 15 日
Hi everybody,
I've got my MATLAB scripts which works totally fine as I run the script itself. As soon as I compile it the .exe seems not to have access on the servers folders where the script is ran from.
path=fullfile(path,'Results');
filepath0=fullfile(path,'*.txt');
fprintf('%s \n',path);
%%Data
%Open data
fprintf('read files \n');
files=dir(filepath0);
fprintf('list files \n');
fprintf(files.name);
fprintf('listed files \n');
When I run the .exe file in the same folder structure (for the relative paths) but on a local drive it work fine (path gets printed, files get listed). When I run the .exe on the server (the user has access but isn't admin) the path gets printed correctly but there is an error with printing "fprintf(files.name);" so it seems like the variable files is completely empty. I think there must be a problem with the permissions. As I say when I run it as the normal script from the very same server folder It work perfectly. How do I tell my exe file that the current user can access those network folders an read out my files?
Thank you a lot!
Benjamin
  1 件のコメント
Image Analyst
Image Analyst 2014 年 9 月 15 日
I think that's an operating system question, not a MATLAB question.

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2014 年 9 月 15 日
You can't do
fprintf(files.name);
do this instead:
fprintf('%s\n', files.name);
  3 件のコメント
Benjamin
Benjamin 2014 年 9 月 15 日
Even after I changed it to fprintf('%s \n', files.name) it doesn't list the files in this Results folder...it doesn't matter if I use the path with the server's IP address, with the server's name or with the mounted network drive
This is always the output
"\\129....\...\Results read files list files listed files"
Image Analyst
Image Analyst 2014 年 9 月 15 日
"path" is a reserved keyword. Try using the name "folder" instead of path and see if that helps.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeApplication Deployment についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by