Thread: how get file attributes in c ?

  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    6

    Angry how get file attributes in c ?

    hi every one

    i'm trying to get and set file attributes in windows using C language

    file attributes like :
    Read-Only
    Hidden
    System
    Volume Label
    Directory
    Archive

    and i don't find any functions to do that

    and i don't use system calls (system("attrib +s fi.txt") function)

    if any one have any information about how do that

    please tell me quickly

    with my respect and best wishes

  2. #2
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Seriously, you didn't look very hard.

    GetFileAttributes Function (Windows)

  3. #3
    Registered User
    Join Date
    Feb 2010
    Posts
    37
    In windows using GetFileAttributes function you can get the attributes of the file.
    In Linux using stat function you can achieve this

  4. #4
    Registered User
    Join Date
    Feb 2010
    Posts
    6
    thanx for UR answer

    but i want to get file attribut in turbe c/c++ ander dos OS>>>?

    so if that is pasuble please tell me abut sow to do that

    with my respect

  5. #5
    Registered User
    Join Date
    Feb 2010
    Posts
    6
    any good tutorials on how to do that?

  6. #6
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Quote Originally Posted by thillai_selvan View Post
    In windows using GetFileAttributes function you can get the attributes of the file.
    In Linux using stat function you can achieve this
    I just use stat() on Windows & UNIX:
    _stat, _stat64, _stati64, _wstat, _wstat64, _wstati64 (CRT)

    Quote Originally Posted by sma88 View Post
    thanx for UR answer

    but i want to get file attribut in turbe c/c++ ander dos OS>>>?

    so if that is pasuble please tell me abut sow to do that

    with my respect
    Check if there's a stat() function in Turbo C++.
    "I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

    "the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problems passing a file pointer to functions
    By smitchell in forum C Programming
    Replies: 4
    Last Post: 09-30-2008, 02:29 PM
  2. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  3. Help Required!!!!!
    By bobthebullet990 in forum C Programming
    Replies: 14
    Last Post: 11-27-2005, 03:56 PM
  4. simulate Grep command in Unix using C
    By laxmi in forum C Programming
    Replies: 6
    Last Post: 05-10-2002, 04:10 PM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 02:58 AM