[cs631apue] Question about st_size
Tejas Nadkarni
tnadkarn at stevens.edu
Mon Oct 7 14:26:26 EDT 2013
Figured it out, was passing st_dev. but need to pass st_rdev. Thanks!
On Mon, Oct 7, 2013 at 2:15 PM, Tejas Nadkarni <tnadkarn at stevens.edu> wrote:
> I'm trying to use major() and minor() to convert st_dev in stat to the
> major and minor for block files. The values I'm getting aren't matching
> what the system ls function returns. Is there anything more than just
> passing st_dev to the major() and minor() macros then printing it out? The
> program compiles and runs fine but I get different values.
>
> Also which files do we need to use major/minor for? block and character?
>
>
> On Mon, Oct 7, 2013 at 1:12 PM, yluo4 <yluo4 at stevens.edu> wrote:
>
>> Sorry, I didn't read the instruction carefully. I has said we should
>> use the major and minor device numbers instead of file size.
>> Yulong
>>
>>
>>
>> On 10/07/2013 11:43 AM, yluo4 wrote:
>>
>>> Hi,
>>> Is st_size in stat only used to check regular file, symbolic file,
>>> and directory file size? I find that other types file's st_size is 0.
>>> How can we get these files' size?
>>> Thank you,
>>> Yulong
>>> ______________________________**_________________
>>> cs631apue mailing list
>>> cs631apue at lists.stevens.edu
>>> https://lists.stevens.edu/**mailman/listinfo/cs631apue<https://lists.stevens.edu/mailman/listinfo/cs631apue>
>>>
>> ______________________________**_________________
>> cs631apue mailing list
>> cs631apue at lists.stevens.edu
>> https://lists.stevens.edu/**mailman/listinfo/cs631apue<https://lists.stevens.edu/mailman/listinfo/cs631apue>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.stevens.edu/pipermail/cs631apue/attachments/20131007/e5931314/attachment.html>
More information about the cs631apue
mailing list