glibc stacking up to Windows

John Haxby jch@scalix.com
Wed May 17 08:09:00 GMT 2006


Michael Lueck wrote:
> http://www.gnu.org/software/libc/manual/html_node/File-System-Interface.html 
>
>
> Delete files, rename files... just don't copy files. "Oh, but it is 
> SUPPOSE to be that way..." Yea right!
>
> Fine, the "science" behind copying a file is much more involved than 
> deleting and renaming them. That is up to the people writing the 
> library to take care of for me. When I see a "File-System-Interface" I 
> expect it to have an extensive list of filesystem related functions. 
> Copy is pretty basic in that regard, thus glibc fails in my opinion.
I could say interesting things about your opinion, but I won't.

I've been writing code on Unix and Linux since, well, it's embarrassing 
-- I work with people who weren't born when I started.  In all that time 
how often have I needed to do that "basic" CopyFile()?   I've got code 
that uses open() and creat() to create files, code that uses rename(), 
link() and unlink() to tinker with names and get to grips with certain 
atomic operations, code to read(), transmute and write() new files or 
update existing ones.    I've got shell scripts, perl scripts, awk 
scripts, tcl scripts, python scripts, you-name-it-scripts that do all of 
those.

Copying files?   Sure.   I don't have anything in this huge source tree 
that I'm working on that copies files in C.   There's some copying in 
shell scripts to create a backup copy before editing the original (ed(1) 
doesn't do backups).   I've just looked back through the history in this 
terminal emulator I have here (points) and there's lots of scp's to copy 
from one machine to another and one scp to recover a file from a backup 
I did before I rebuilt my machine after a disk crash.

Far from being "pretty basic", copying files in Unix/Linux/Posix is 
actually pretty rare because the file system supports operations that 
make that largely unnecessary.   Windows doesn't have (proper) symbolic 
links and doesn't have (hard) links at all and that makes copying far 
more common ...

Before you start a war to turn Linux into Windows, get to grips with 
Linux as a different operating system.   If something "pretty basic" 
isn't there, ask yourself "why?" not "where?".   The "why" will take a 
lot longer to answer but you might, if you're not too blinkered, learn 
something new.

jch



More information about the Libc-alpha mailing list