Find the answer to your Linux question:
Results 1 to 2 of 2
hi all i would like to get filesize by programatically. is there any way thank you in advance...
  1. #1
    Linux Newbie
    Join Date
    Feb 2007
    Location
    hyderabad, india
    Posts
    247

    getting filesize

    hi all
    i would like to get filesize by programatically.
    is there any way

    thank you in advance

  2. #2
    Just Joined!
    Join Date
    Jan 2007
    Posts
    23

    Smile getting file size

    hi,

    u can use stat or lstat ...refer to man pages...below code may help u..

    void filsize(char *name)
    {
    struct stat buf;
    if(stat(name,&buf)==-1)
    printf("Can't acces filenmae %s\n",name);

    printf("filesize=%ld\n",buf.st_size);
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...