How do I find the path of an external hard drive plugged into my device with MatLab?

조회 수: 12 (최근 30일)
I am using an external hard drive on multiple devices on the same network. I need to access data on a single external hard drive across these multiple devices.
I would like to have a few lines in my code before loading the data from this external hard drive that runs a search for the hard drive name without me having to change it every time I plug the hard drive into a different device.
Is there a way to do this?

답변 (1개)

Jan
Jan 2018년 4월 19일
The answer depends on the used operating system. Under Windows you can check the existence of a file by changing the drive letter, but this does not work under MacOS and Linux.
If you are working in a network, a trivial solution is to share your device as a network folder. Then you can access it by the UNC path (under Windows): //192.168.1.10/SharedFolder .
Why do you want to search for the "hard drive name", especially "without me having to change it every time"? Does your hard drive has a different name for each access?

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by