Tuesday, May 17, 2016

File processing checklist

1) On Linux you cannot use rename () function if the file is being moved across file systems. So play safe and use system("mv") command.
2) Verify that there is space on the filesystem before processing.
3) Verify the file size before and after file operations is the same , use fstat/stat system call.
4) Verify the current working directory to be sure the fullpath of the file is used
5) While dealing with traversing directories, pay attentions to sub-directories and '.' and '..' folders.


No comments:

Post a Comment