file server/ reading struct from a file

Discussion in 'C' started by engine_er21, Jan 13, 2008.

  1. engine_er21

    engine_er21 New Member

    Joined:
    Oct 13, 2006
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    hi, I m studying on a file server project. It won t be a real file server project but it will behave like a real file server. It will be written in c. Let me explain it:
    there are two kind of users: supervisor and normal user. there will be commands like login, dir, delete,....with their parameters but commands will be written in c. no system commands will be used. There are some restrictions about users. For example a normal user won t be able to open a file for changing or deleting...It s a little long and it s in turkish. Can you just give me an idea about this project?
    My second question, I tried to create a file and put my user information(as struct) into that. but when opening file it s failed. For example when I m trying to login even if username exists it says "no such username!", I m doing that by using the same struct, I read it with fread and put my information in my struct then search it in struct, but it fails. I tried to write on screen it works but writess meaningless information like 7848736828. Can you help me, thanks
     
  2. engine_er21

    engine_er21 New Member

    Joined:
    Oct 13, 2006
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    I translated the full project into english it s urgent please help!
    a file server which serves to several users will be created in this project.
    EXPLANATION
    in this system the processes will run under SERVER directory. SERVER directory s struct shown
    below
    SERVER
    I
    I___ public
    I
    I___ system
    I
    I___ user
    I I
    I I___george
    I I .
    I I .
    I I___ mary
    I
    I___ spool
    I
    I
    I___ george
    I .
    I .
    I___ mary
    1.DIRECTORY'S PROPERTIES
    the properties and contents of directories under SERVER will be like shown below
    public: basic commands like dir,copy,delete and logout which every users have permission to access
    will be under that directory.
    system: Programs to create a new user which only authorized users can access will be under that
    directory
    user: when a new user created under sysadmin program, for this user, a new directory will be opened
    with the same name(username)
    spool: with sendf command a file which a user send file to another user, the file will be copied under
    another user in the spool directory, receiver-user will be able to take the file to its own directory. The
    received file must be deleted
    2. SUPERVISOR OPERATIONS
    Users with supervisor authority will be able to these operations:
    Creating a User
    a user with the same authorith with supervisor will be able to create a new user. sysadmin program will
    be used to create a user, change user informations, delete user or see a existing user information.
    when program is ran for change, the user informations as shown below will be saved in a table, as the
    questions and corresponding answers.
    unauthorized users only can view the user information below
    User Name :
    Account Restrictions :
    Account Disabled : (Yes/No)
    Expiration Date : (MM/DD/YY)
    Allow User to Change Password : (Yes/No)
    Require Password : (Yes/No)
    Minimum Password Length :
    Limit Grace Logins : (Yes/No)
    Grace Logins Allowed : max password you can enter
    Remaining Grace Logins : in every error password enter, it will decrement by 1
    Security Equivalence : 0(Supervisor authority), 1(Normal user authority)
    Change Password : new Password
    Full Name : user's full name
    Last Login : user's last login.
    Disk Space In Use : it will change whenever use different space size
    Total Disk Space : user's total disk space
    when these questions answered a new directory(username) will be created under the user and spool
    directory
    Deleting users:the deleted user's information will be deleted from the user table.
    3.User Commands
    login: user must use login command to work in his/her workspace.
    format: login username
    dir: if the given argument is refer to a accesible path it views the list under this path
    format: dir filename
    copy: if a user is authorized it is used to copy a file
    format: copy soucefileName destionationfileName
    delete: if the user is authorized it deletes the file
    format: delete sourcefileName
    sendf: it is used to send a file from a file to another user
    format: sendf filename to userid
    readlist: it is used to view the list of files onder his/her spool workspace
    format: rl
    receive: it s used to receive the files in his/here spool workspace
    format: receive filename
    setpass: it can be used by users who can change their password. when the command run, the current
    password of the user asked, if right the new password requested, if the entered password is enough
    long the process is successful,
    whoami: when this command run the active user will be shown
    logout: active user will log out
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice