[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: smbfs question...



> 
> so, now i have a question for the list.  i guess i can accept this
> behavior, but now i'm curious: what does /bin/mv do when the target
> file already exists (and isn't a directory).  it must do something
> other than unlink the target file and relink the source file to that
> name, right?  otherwise, it seems like it should work.
> 

stat("acout.57vRTc", {st_mode=0404, st_size=0, ...}) = 0
lstat("acout.3Dh0Oi", {st_mode=S_ISUID|0161, st_size=0, ...}) = 0
lstat("acout.57vRTc", {st_mode=0404, st_size=0, ...}) = 0
rename("acout.3Dh0Oi", "acout.57vRTc")  = 0

That is the end of the mv call.  Do strace -o <file> <command>.  Look in file,
you will find every system call the program made.

Now if you are truly curious, you could grab the source for glibc and look at
the rename fuction and see what it does.

The stat() calls check perms and what not.


Reply to: