![]() |
|
|
|
#1 |
|
"MM" <> wrote in message news:RkePa.1076$... > Two questions about file acces/handling: > > 1) How do I easily check if a certain file (say "testfile.dat") exist in the > current directory? > > 2) Is there a nice way to (platform independently!) remove/delete a file in > C? > Using for example > system("del filename.txt"); > doesn't work for me, of course, since "del" is not OK in UNIX... > > MM > > > Unfortunately, Standard C does not provide any way to check for existence of a file. You can try opening it and check for failure, but that's about it. As for deleting a file, C provides the rename() library function. Eric Bernard Eric Bernard |
|
|
|
|
#2 |
|
Posts: n/a
|
Eric Bernard wrote:
> Unfortunately, Standard C does not provide any way to check for existence of > a file. You can try opening it and check for failure, but that's about it. > As for deleting a file, C provides the rename() library function. You mean "remove()" right? Tom Tom St Denis |
|
|
|
#3 |
|
Posts: n/a
|
|
|
|
|
#4 |
|
Posts: n/a
|
"Eric Bernard" <> wrote in message news:BQePa.9377$.. . > > "MM" <> wrote in message > news:RkePa.1076$... > > Two questions about file acces/handling: > > > > 1) How do I easily check if a certain file (say "testfile.dat") exist in > the > > current directory? > > > > 2) Is there a nice way to (platform independently!) remove/delete a file > in > > C? > > Using for example > > system("del filename.txt"); > > doesn't work for me, of course, since "del" is not OK in UNIX... > > > > MM > > > > > > > > Unfortunately, Standard C does not provide any way to check for existence of > a file. You can try opening it and check for failure, but that's about it. > As for deleting a file, C provides the rename() library function. > > Eric Bernard > > s/rename/remove/ indeed. Althought rename is also a standard function. Sorry about that mistake. Eric Bernard |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SONY DVD RW DW-G120A SOMETIMES FAILS...... | atlantic965 | DVD Video | 0 | 06-18-2006 10:36 PM |
| problems backing up dvds | Lawrence Traub | DVD Video | 11 | 09-27-2005 07:34 PM |
| Re: Ripping DVDs. Please answer the attached question. - Question.txt | Stan Brown | DVD Video | 19 | 02-09-2005 11:19 PM |
| Burn process failed - help! Log file posted for help troubleshooting | Michael Mason | DVD Video | 1 | 08-16-2004 09:24 PM |
| Pioneer A05 Problems | Bill Stock | DVD Video | 8 | 11-28-2003 05:03 AM |