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

12 ビュー (過去 30 日間)
Nathaniel Werner
Nathaniel Werner 2018 年 4 月 19 日
回答済み: Jan 2018 年 4 月 19 日
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 Center および File ExchangeMATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by