LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 05-08-2013, 12:17 PM   #1
RudraB
Member
 
Registered: Mar 2007
Distribution: Fedora
Posts: 262

Rep: Reputation: 23
better practice to work with saved buffer


hello friends,
I am working on a gtk_list_store, that will save the rows to a file
(set_contents(file, buffer))
After saving the datas to a file, without exiting, I will like to edit
the file (as buffer) again. For that I have 2 option in my knowledge:

1) save the data, g_free(buffer), list_store_clear, reload the saved
file
2) save the buffer to the file, but continue working with that without
g_free(buffer)

both seems to work, but which is the better practice?
 
Old 05-08-2013, 12:33 PM   #2
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 657

Rep: Reputation: 66
what is the reason of saving the data to file? if it is just a persistence across application restarts, then the second option is better
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can this harddrive be saved? not data recovery. Gparted doesn't want to work with it. keithostertag Linux - Hardware 3 02-19-2013 07:05 PM
How does the sed buffer space work? ShanxT Programming 5 10-11-2011 10:53 AM
Does OCR work in practice, kooka ocrad? lugoteehalt Linux - Newbie 7 02-04-2009 12:12 PM
What is the difference between the free buffer and buffer in the buffer hash queue? Swagata Linux - Enterprise 0 05-25-2006 11:57 PM
frame buffer doesn't seem to work hubabuba Fedora 2 05-03-2005 12:39 PM


All times are GMT -5. The time now is 10:48 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration