![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Professional Programmer
|
Alright. I'm making a flashcard program that needs to be completed in the next 30 minutes. Basically, I need help with writing the file to disk.
I need to write my file to disk without simply adding on to my previous file. I can only have 1001 "cards". How do I wipe the contents of a .txt file clean without deleting the entire file? Last edited by Indigno; Mar 14th, 2006 at 7:58 PM. |
|
|
|
|
|
#2 |
|
Expert Programmer
|
submerse yours computer in water, works for me every single time.
__________________
Clifford Matthew Roche <geek@cliffordroche.com> Web Hosting: http://www.crd-hosting.com Consulting: http://www.crdev-consulting.com |
|
|
|
|
|
#3 |
|
Expert Programmer
|
Or you could try truncating the file... there must be a million ways to do this pragmatically by now. Seriously, dumb question man
![]()
__________________
Clifford Matthew Roche <geek@cliffordroche.com> Web Hosting: http://www.crd-hosting.com Consulting: http://www.crdev-consulting.com |
|
|
|
|
|
#4 |
|
Professional Programmer
|
nice constructive help there.
|
|
|
|
|
|
#5 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Open it to write (not append) to, and save it.
|
|
|
|
|
|
#6 |
|
Programming Guru
![]() ![]() ![]() |
ooble is right, don't open the file in Append mode... Write mode will overwrite the file every time. The "next 30 mins" have surely passed... so hopefully you googled for this and found the solution.
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#7 |
|
Professional Programmer
|
I did get it done on time. Thanks anyways.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|