lkml.org 
[lkml]   [2001]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectrename problem on vfat file systems
Hi,

I have been having problems using rename system call
on vfat file systems. I have looked at the kernel code
and tried everything I could do to figure out what
might be going wrong. As a last resort I thought you
might be able to help me.

The /etc/fstab entry for the drive that I mount looks
like this

/dev/sdc1 /mnt/sns-c vfat noauto,sync,user 0 0

here's the code snippet of what I am trying to do

int copy_seg_file(char *segFile)
{
char command[128];
sprintf(command, "cp %s /mnt/sns-c/tmp/segfile",
*segFile);
system(command);
sync();
rename("/mnt/sns-c/tmp/segfile",
"/mnt/sns-c/segments/segfile");
printf("file copied\n");
}

initially the file is copied to the temporary
directory to deal with the power outage during the
file copy. Once the file is completely copied, it will
be renamed to the final destination.

If I reboot the machine just after the rename() call
is completed, when the machine comes up the file
/mnt/sns-c/segments/segfile has zero bytes and there
is no file in the tmp directory. Effectively the file
is lost some where. Running fsck recovers the file,
but it doesn't help me much because I would be copying
hundreds of files and its difficult to match the
files.

Can you think of any thing that might be causing this.
Any help is highly appreciated.

Thanks,
Kumar

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:55    [W:0.094 / U:0.700 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site