exporting file from linux file system to my own file system

Hi, Can you help me write the following function?


/*
 * Exports a u_file to linux.
 * Need to take care in the order of modifying the data structures
 * so that it can be revored consistently.
 */
int u_export(char* u_file, char* linux_file)
{
        /*
          write code for exporting a file to linux.
          return 1 for success, 0 for failure

          check ok to open external file for writing

          check userfs file exists

          read the data out of ufs and write it into the external file
        */

        return 0;
}
achille67Asked:
Who is Participating?
 
stefan73Commented:
Use the stat() command. It will return you a lot of information about a given inode (file), including its size.

Check "man stat". Be careful that file sizes CAN be >2GB, so always use the off_t data type for file size operations.
0
 
stefan73Commented:
Hi achille67,
What is your intention of "exporting file from linux FS to own FS"? Normally, you'd use FTP, scp, Samba or NFS for this.

Cheers,
Stefan
0
 
da99rmdCommented:
It still not appropriate to ask homework questions try makeing the function your self and we will try to help you if you have any errors or questions.
/Rob
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
da99rmdCommented:
It still not appropriate to ask homework questions try makeing the function your self and we will try to help you if you have any errors or questions.
/Rob
0
 
achille67Author Commented:
I would like to mention that this is not a homework problem, This is just piece of an entire project. i will be glad if you could help out
0
 
achille67Author Commented:
hi modulo,
I just email you

thanks
0
 
achille67Author Commented:
Hi everyone,
How could check to see whether a file size > or ==  to some value?
(in C language)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.