[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] Flytning af fil/directory i C++



On Tuesday 10 November 2009, Jens Bang wrote:
> Jeg er i gang med at skrive et program der bl.a. skal flytte en hel del
> directories over i en ny struktur. Hvordan gør jeg det nemmest?
>
> Jeg havde overvejet
> 	execl("/bin/mv","mv",oldpath,newpath,NULL);
>
> Men det ser ud til at hvis mv løber ind i problemer så stopper den mit
> program. Så er der et bedre alternativ?

Jeg har nu indset at det er mig der fuldstændig har misforstået execl. Den 
erstatter mit kørende program med det jeg kalder, hvilket betyder at mit geet 
program stopper lige meget om det kaldte program klarer opgaven eller ej. Det 
jeg er ude efter er en funktion der kører en bestemt ordre og derefter 
returnerer til mit program med en retur værdi fra det kørte program. Så jeg 
kan fortsætte mit eget programs kørsel.

-- 

        |\     _,,,---,,_       Greetings, Jens
 ZZZzz /,`.-'`'    -.  ;-;;,_
      |,4-  ) )-,_. ,\ (  `'-'  sslug@sslug
     '---''(_/--'  `-'\_)
----------------------------------------------------
If you want it done right, forget Microsoft.



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2009-12-01, 02:01 CET [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *