I tried the copy char by char method but it doesn't seem to work very efficiently.
char by char copy is really inefficient (just because of the overhead of every system call). You really should buffer it, and I suggested kilobytes
by kilobytes copy. Maybe a 4Kb or 16Kb buffer is better than a 1Kb one but you really should avoid copying one byte per one byte.
I think nautilus shows the free space in the current folder (read: free space in partition where folder is) in the bottom of the screen.
You can get the information with the stat(2)
system calls. RTFM, so look at the output of
man 2 stat
man 2 statfs
Basile Starynkevitch (France)