How can I get the filesystem sector size from unix/linux/osx and windows?

I want to be able to determine at runtime what the sector size is for a give filesystem. C code is acceptable. for example I format my Data partitions with a 32k sector size that have lots of large video files. I want to be able to get this value at runtime.

Answers


I think you want statvfs (if by pagesize you mean sector size?) which from what I remember works linux and OSX. I think you need to use the f_bsize field but I unfortunately do not have a linux box to test against atm.

For windows you want the GetDiskFreeSpace function.


Need Your Help

Changing width of div in % syntax

javascript jquery css

Very simple question, just having trouble with syntax.

how to get the Hidden Columns Control Value in PreparingCellForEdit Silverlight Datagrid

silverlight datagrid silverlight-4.0

how to get the Hidden Columns Control Value in PreparingCellForEdit Silverlight Datagrid

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.