file

Discussion in 'C Programming' started by ashu, Jul 19, 2007.

  1. ashu

    ashu Guest

    i want to make a program that accept a file and chechs if it is
    readable and writable and give appropriate messeage ?
    i can make program to accpet filename from command line and open it in
    any omde and write data in it, but to know its permission is seems
    tricky, is there apecific function available ?
    ashu, Jul 19, 2007
    #1
    1. Advertising

  2. ashu wrote:
    > i want to make a program that accept a file and chechs if it is
    > readable and writable and give appropriate messeage ?
    > i can make program to accpet filename from command line and open it in
    > any omde and write data in it, but to know its permission is seems
    > tricky, is there apecific function available ?
    >


    Not in Standard C.
    If you're using a POSIX-compliant system, look for stat(2) and fstat(2).


    --
    Pietro Cerutti

    PGP Public Key:
    http://gahr.ch/pgp
    Pietro Cerutti, Jul 19, 2007
    #2
    1. Advertising

  3. ashu

    santosh Guest

    On Thursday 19 Jul 2007 7:53 pm, ashu <>
    wrote in message
    <>:

    > i want to make a program that accept a file and chechs if it is
    > readable and writable and give appropriate messeage ?
    > i can make program to accpet filename from command line and open it
    > in any omde and write data in it, but to know its permission is
    > seems tricky, is there apecific function available ?


    Yes, but you need to ask in a group for your system. If it's UNIX or
    Linux, I suggest news:comp.unix.programmer or
    news:comp.os.linux.development.apps. If it's for Windows then
    news:comp.os.ms-windows.programmer.win32 might be appropriate. Also
    take a look at the man pages on your system, (if it's a UNIX), or
    browse Microsoft's MSDN online documentation, for Windows.
    santosh, Jul 19, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Luis Esteban Valencia Muñoz
    Replies:
    3
    Views:
    1,392
    Scott Allen
    Jun 4, 2005
  2. Dave
    Replies:
    1
    Views:
    978
    Juan T. Llibre
    Jun 8, 2007
  3. =?ISO-8859-2?Q?Miros=B3aw?= Makowiecki

    Reading of file by next of map file and by next of file descriptor.

    =?ISO-8859-2?Q?Miros=B3aw?= Makowiecki, Jul 10, 2007, in forum: C++
    Replies:
    1
    Views:
    779
    Alf P. Steinbach
    Jul 10, 2007
  4. scad
    Replies:
    4
    Views:
    942
    James Kanze
    May 28, 2009
  5. Ludwigi Beethoven
    Replies:
    5
    Views:
    313
    Mike Hall
    Jul 26, 2003
Loading...

Share This Page