フィルターのクリア

Read size of the file in Windows Server 2012

1 回表示 (過去 30 日間)
Kanchibhotla Chandra Sekhar
Kanchibhotla Chandra Sekhar 2018 年 8 月 14 日
I want to read the file size in windows server 2012. I have used the -
files_log = [ dir(fullfile(cd,'Matlab_log_file.txt'))];
which is working in the local pc but not in the windows server 2012. What is the best way to read the file size ?

回答 (1 件)

Jan
Jan 2018 年 8 月 14 日
files_log = dir(fullfile(cd, 'Matlab_log_file.txt'));
(without the unneeded square brackets) is still the best and working code on every operating system and file system. So check twice, what is not working as expected, and post any details about this problem here. Maybe your current directory is not where you expect it to be.
  1 件のコメント
Kanchibhotla Chandra Sekhar
Kanchibhotla Chandra Sekhar 2018 年 8 月 20 日
@Jan, I think the "cd" in the code is creating the problem. Since in the we are using the the compiled matlab file in the production server of Windows Server 2012. It is even difficult to check the when server is running. But i didnot get a chance of checking what is the exact problem when that line executes.
try
files_log = dir(fullfile(cd, 'Matlab_log_file.txt'));
catch Me
disp(Me.message);
end

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

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

製品


リリース

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by