端口窗口Api --- GetVolumeInformation到Linux [英] Port Window Api---GetVolumeInformation to Linux
问题描述
Win Api
Win Api
BOOL WINAPI GetVolumeInformation(
_In_opt_ LPCTSTR lpRootPathName,
_Out_opt_ LPTSTR lpVolumeNameBuffer,
_In_ DWORD nVolumeNameSize,
_Out_opt_ LPDWORD lpVolumeSerialNumber,
_Out_opt_ LPDWORD lpMaximumComponentLength,
_Out_opt_ LPDWORD lpFileSystemFlags,
_Out_opt_ LPTSTR lpFileSystemNameBuffer,
_In_ DWORD nFileSystemNameSize
);
您好:我想将Windows api GetVolumeInformation移植到Linux。
Q1:Linux是否具有相同的功能。
Q2:如果没有。
Q2.1 linux中的lpVolumeNameBuffer是什么(是/ dev / sda1)?我如何在linux中获取它?
Q2.2什么是linux中的lpVolumeSerialNumber(是)?我使用ioctl得到它。
Hello: I want to port windows api GetVolumeInformation to Linux.
Q1:Does Linux have the same function.
Q2:if not.
Q2.1 what is lpVolumeNameBuffer in linux(is /dev/sda1)? how can i get it in linux?
Q2.2 what is lpVolumeSerialNumber in linux(is )? i use ioctl get it.
struct hd_driveid id;
ioctl(fd, HDIO_GET_IDENTITY, &id);
Q2.3 linux中的lpMaximumComponentLength是什么?我怎样才能在linux中获得它?
Q2.4 linux中的lpFileSystemFlags是什么?我怎样才能在linux中获得它?
Q2.5什么是lpFileSystemNameBuffer?我如何在linux中获得它?
如果您有任何好主意我会非常感激。
谢谢!
Q2.3 what is lpMaximumComponentLength in linux? how can i get it in linux?
Q2.4 what is lpFileSystemFlags in linux? how can i get it in linux?
Q2.5 what is lpFileSystemNameBuffer? how can i get it in linux?
If you have any good ideas I would really appreciate it.
Thanks!
推荐答案
这在Linux中并不那么容易。
请参阅: http://stackoverflow.com/questions/9178360/getting-disk-label-in-linux-in-cc [ ^ ]。
注意建议所以使用C ++和Boost.Filesystem,引用。
-SA
This is not so easy in Linux.
Please see: http://stackoverflow.com/questions/9178360/getting-disk-label-in-linux-in-c-c[^].
Pay attention for the advice so use C++ and Boost.Filesystem, referenced.
—SA
你最好在linux论坛中提出这个问题。这里至多是M
you better ask that question in a linux forum. Here are at most M
-guys ...
-guys...
这篇关于端口窗口Api --- GetVolumeInformation到Linux的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!