Unix "system " command

Discussion in 'C Programming' started by aki, Aug 4, 2008.

  1. aki

    aki Guest

    Hello ,

    i want to use system commnad in my code to delete files in specified
    manner.
    but this way i am not able to delete files.
    Can somebody answer .



    i tried with this as following , but not working :(
    string omcid;
    string netype ;
    string nename ;

    //some stuff to get values inside these string variables

    cout<<"omcid"<<omcid<<endl; // here i printed the value it
    iscoming correct
    cout<<"netype"<<netype<<endl;// here also
    cout<<"nename"<<nename<<endl; // here also
    system( ("rm -f /path/" + omcid + '_' + netype + '_' + nename
    +"_*_trans.csv").c_str() ) ;

    thanks
    aki
     
    aki, Aug 4, 2008
    #1
    1. Advertising

  2. aki

    santosh Guest

    aki wrote:

    <news:comp.lang.c++>
    <news:comp.unix.programmer>
     
    santosh, Aug 4, 2008
    #2
    1. Advertising

  3. aki

    aki Guest

    On Aug 4, 5:20 pm, santosh <> wrote:
    > aki wrote:
    >
    > <news:comp.lang.c++>
    > <news:comp.unix.programmer>


    it was due to inccorrect path ...
    now i is working fine..

    thanks
    Aki
     
    aki, Aug 4, 2008
    #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. Replies:
    12
    Views:
    1,701
    Dave Thompson
    Jan 10, 2005
  2. Replies:
    4
    Views:
    1,767
    Terry Hancock
    Apr 23, 2005
  3. markus
    Replies:
    22
    Views:
    682
    Dances With Crows
    Sep 22, 2004
  4. Replies:
    18
    Views:
    656
    Dave Thompson
    Jan 10, 2005
  5. boriq
    Replies:
    4
    Views:
    624
    Tim Golden
    Jun 12, 2008
Loading...

Share This Page