Determine what access level you have in a network drive

조회 수: 5 (최근 30일)
Darin McCoy
Darin McCoy 2011년 7월 27일
답변: Campbell 2017년 8월 11일
Hi,
I'm trying to figure out what access level i have in a particular folder (do i have read access? do i have write access? or is access denied?)
i tried
fileattrib('\\ACGFS01.mw.na.cat.com\SharesAC\6Sigma988')
but that doesn't work....the results it gives me aren't accurate
ans =
Name: '\\ACGFS01.mw.na.cat.com\SharesAC'
archive: 0
system: 0
hidden: 0
directory: 1
UserRead: 1
UserWrite: 1
UserExecute: 1
for this case, it should tell me that i don't have read or write access...but it tells me i have both

채택된 답변

Walter Roberson
Walter Roberson 2011년 7월 27일
Unfortunately this information is not certain to be available over NFS (Networked File System, originally for Sun's Unix), nor in connection to any networked file system which implements Access Control Lists.
  댓글 수: 2
Darin McCoy
Darin McCoy 2011년 7월 27일
so its just not possible? Is the root problem with the windows OS? or the design of NFS? or....?
Walter Roberson
Walter Roberson 2011년 7월 27일
It is a design limitation that applies to many networked file systems, having to do with the fact that most networked access requests do not really involve logging you on to the remote system, with a network process acting on your behalf. Authenticating that it is "really" you is a technical challenge. There are some file systems such as Kerebos (from MIT) that were designed to be able to securely work with access credentials through a network, but most networked file systems do not have that ability.
There is also a problem between Unix systems and Windows systems, in that there is a difference in semantics in some of the permission bits between the two, if I recall correctly.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Campbell
Campbell 2017년 8월 11일
A work-around for the incompatibility of Window and Linux operating systems that I have used is to attempt to open a file in the directory of the NFS server, e.g.
f1 = fopen(fullfile(nfsDir, 'existingFile.txt', 'r');
readPermission = f1 > 0;
if readPermission, fclose(f1); end
f1 = fopen(fullfile(nfsDir, 'newFile.txt', 'w');
writePermission = f1 > 0;
if writePermission, fclose(f1); end

카테고리

Help CenterFile Exchange에서 Manage Products에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by