Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with homework
#11
Does your program have information for all the contacts or only one?
Reply
#12
(Apr-28-2020, 06:52 PM)deanhystad Wrote: Does your program have information for all the contacts or only one?

I think is only one because it searches it first and then you modify it
Reply
#13
So there is not a page where you can see the entire contacts database? Too bad, because it would be really easy to write a new contacts database file from scratch if we had all the contacts.

I'll assume that each entry in the contacts database can be a different size, and the size of the updated entry may not match the size of the old entry. That would eliminate doing something surgical like using lseek to go to a particular location in the file and overwriting some bytes. That leaves the brute force methods: read entire file into memory, modify and write, or make a copy of the file and use that to build a new file.

Your choice. What sounds better to you?

I missed your update to an earlier post. Is your contacts file a database file? I missed that when I peeked at your code. That does provide additional options.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020