Unrepairable file permissions OSX 10.6.8

The same list of file permissions are always repaired each time the permissions utility is run. How come? Is it a bad thing?

No, ignore them and trust DU's repair permissions to do its job.  You are always going to see a bunch of messages.
Disk Utility's Repair Disk Permissions messages that you can safely ignore
If you don't want to see those messages uncheck the Show Details checkbox.
Why are you repairing permissions at all?  It is generally unecessary.

Similar Messages

  • Why won't OSX update? I checked file permissions, NG.

    When I try to update OSX, I keep getting an error message. I have done a clean reinstall on the OS, used Disk Utilities to check the HD and verify file permissions. When verifying file permissions, all kinds of new permissions are granted. I don't understand these or where else to look for help, as updates still won't install.
    Is this worth pursuing, or do I have a HD or logic board problem here?
    PB 12" 1.33G   Mac OS X (10.4)   bought used 40G HD installed

    Did you verify file permissions or repair file permissions? The latter is what you need to do. Have you tried it with the Mac OS X 10.4.6 Combo Update?
    Yang

  • OSX and icml file permissions

    Hello!
    I've downloaded the trial version of InCopy in order to test its inclussion into our magazine workflow. InDesign is installed in my mac while InCopy is installed in my wife's MacBook Pro.
    With all this said I need help with a problem I have with the file permissions: If I create an assignment in my computer the icml file that is generated has read/write permission for the administrator only (me). In order to allow my wife to access the file I have to manually add read/write permissions to "Staff" and "Everyone" under the file info panel.
    Does anybody know how to give full access to newly created files to anyone? Or better yet, how to tell my computer that my wife needs full access to my files?
    Thanks a lot for reading

    Hello!
    I've downloaded the trial version of InCopy in order to test its inclussion into our magazine workflow. InDesign is installed in my mac while InCopy is installed in my wife's MacBook Pro.
    With all this said I need help with a problem I have with the file permissions: If I create an assignment in my computer the icml file that is generated has read/write permission for the administrator only (me). In order to allow my wife to access the file I have to manually add read/write permissions to "Staff" and "Everyone" under the file info panel.
    Does anybody know how to give full access to newly created files to anyone? Or better yet, how to tell my computer that my wife needs full access to my files?
    Thanks a lot for reading

  • How do I stop DW CS6 randomly changing file permissions via FTP?

    How do I stop Dreamweaver CS6 12.0.1.5842 randomly changing file permissions when it uploads files to my web server via FTP.
    I can no longer trust Dreamweaver to upload websites correctly as it changes permissions on some files which then deny the server access to the file which in turn makes the webpage unreachable/return a 403 error.
    This is driving me insane.
    I'm using an early 2011 Macbook Pro 10.7.5.

    Hi,
    I'm having this problem too. Has Adobe fixed the issue yet? This appears to be an Adobe problem, not all the web hosts out there. CS6 is ramdomly (meaning: not every time) changing permissions on files uploaded with it and is not usable for web work until this problem is fixed by Adobe or a solution is provided. If I wanted to use a separate FTP program I would not have recommended that my employer buy multiple Adobe CS6 product licenses. One of the primary appeals of DW is the integration of FTP into the workflow.
    I am using a destop iMac2.8 GHz Intel Core 2 Duo, 4 gigs of 800 MHz DDR2 SDRAM.
    OSX 10.7.5
    I am using DW Version 12 Build: 5808
    Dreamweaver CS4 that I was using until this new purchase was working just fine. No file permisssion changes. I am being forced to go back to using it until Adobe posts a fix for this.
    I should ask while I'm here: has anyone found a solution for this yet?
    Thanks,
    -c-

  • Beware Moving Files in OSX Lion

    Anybody having problems moving files in OSX Lion?  I tried to move some files from my Downloads folder to a USB Flash Drive and it looked like the file moved successfully but the file doesn't exist in either my USB Flash Drive nor my Downloads folder.  The files just disappeared.
    The only way to fix this problem is to reboot the machine.  Eventually, the OS will get back into this state and you won't know it until you try to move some files and end up losing them instead.  This is the third time this has happened to me since upgrading to OSX Lion.

    Repairing the permissions of a home folder in Lion is a complicated procedure. I don’t know of a simpler one that always works.
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the page that opens.
    Drag or copy – do not type – the following line into the Terminal window, then press return:
    chmod -R -N ~
    The command will take a noticeable amount of time to run. When a new line ending in a dollar sign ($) appears below what you entered, it’s done. You may see a few error messages about an “invalid argument” while the command is running. You can ignore those. If you get an error message with the words “Permission denied,” enter this:
    sudo !!
    You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning not to screw up.
    Next, boot from your recovery partition by holding down the key combination command-R at startup. Release the keys when you see a gray screen with a spinning dial.
    When the recovery desktop appears, select Utilities ▹ Terminal from the menu bar.
    In the Terminal window, enter “resetpassword” (without the quotes) and press return. A Reset Password window opens.
    Select your boot volume if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select  ▹ Restart from the menu bar.

  • Can you help? -- Browser Webpage Loading Problems after Repairing File Permissions with Disk Utility

    Hello,
    I have been experiencing extremely slow startup times and slow application startup times for the past month on my 7-month old iMac.
    I read in many places, including the Apple communities, that "repairing file permissions" using the Mac Disk Utility would help. So I ran it and now all my browsers including Safari and Firefox will not load or take 5 to 10 minutes to load a webpage - especially websites that have login features (eg. Gmail, Facebook, Hotmail).
    As of my last re-start, Firefox will not load webpages and Safari is extremely slow at opening anything.
    Has this problem occured for anyone after "repairing file permissions"?
    And can anyone assist?
    Thank you,
    Shane

    The Solution?
    REINSTALL OSX using the Install DVD.
    I called APPLE Support and we went through a troubleshooting process to rule out Network Issues, Software Issues, File Issues and Hardware Issues. This process was very thorough.
    In the end, we used the Operating System Installation DVD to reinstall the system, which took about 60 minutes including downloading the updates. Reinstallation did not affect any files or lose any applications. Everything was as I left it -- nothing was missing. Easy.
    Now everything is back to normal.

  • File permissions - how to edit a user account

    file permissions - how to edit a user account that is creating files with permissions that are not wanted anymore.
    i understand how to reset permissions on files or folders, but i do not understand how to reset the permissions a user is "creating".
    ie, each time this user creates a file, the file needs to be manually edited for its permissions. so i need to edit the user's settings, but i can't find where to do that.
    this is a home office setup. we have two users with admin privileges. our imac is acting as a server of sorts - it holds common files that need to be edited by both users. the other user is typically working on shared files from a macbook over wifi.
    osx 10.6.8
    any help is greatly appreciated - thanks up front!
    adam

    Király wrote:
    Changing the umask does not produce reliable results. Many apps, including Apple's own Finder, will override any custom umask setting and apply the OS X standard set of read and write for the creator, and read only for group and others. This is true even in Snow Leopard
    I cannot argue with you, because I've never tried or tested it myself. However, this KB article
    <http://support.apple.com/kb/HT2202>
    states the opposite:
    "In Mac OS X v10.5.3 and later, you can create the file /etc/launchd-user.conf with the contents "umask nnn". […]
    This will set the user's umask for all applications they launch, such as Finder, TextEdit, or Final Cut Pro, and control the permissions set on new files created by any of these applications."

  • Filie permissions

    Since upgrading to MAC 10.6 others on my network cannot edite and save files.PCs onthe network can open site files but in one case they get asked to make the file writable but can't save the file except as a new file, or they get a message that "Access to \\a path on the Mac computer\MFCD.tmp was denied.
    I checked that the file permissions on the MAC are all set to allow read and write! Dreamweaver is restrickting access.
    Help!
    Please
    Nick

    I started having this very same problem (dreamweaver CS4 on pc editing files on a share on a OSX machine) getting "access to ....tmp denied" after I modified permissions on the OSX for someone else to have access.
    In the end I had to remove the permissions of that other person to my folders on OSX and then everything was back to normal. Very weird, and yes that other person was not editing my files at the same time, in fact he wasn't even in.
    So try setting the permissions so you are the only one having read&write permissions to the files you're editing and see if you still have the error. Must have something to do file access permissions in OSX.

  • Safari 5.1 file permissions of com.apple.Safari.plist (Read only impossible???)

    Hi everyone,
    i try to set the user agent to a differnt string. To be sure that the changes in com.apple.Safari.plist are valid i copied the file after i set safari to the changes i want it to have. i did not write anything into the file by hand. Then i set the permission to the file to Read only for my user and copied the file back to ~/Library/Preferences.
    After starting safari it sets everything back to its defaults. Safari also changes the file permissions back to read&write for my user. How can i write protect this file?
    If thats not possible, does anyone have an idea how to set the user-agent of safari to another string as default value? btw. i also would like to know how to set private mode to on by default.
    I don't want to change my browser just because a simple configuration file's permission cannot be set permanently.
    Thanks for your help!

    after searching a long time i found a solution for the user-agent problem. Well it's not what i wanted in the first place, but at least this works. I can hide the user agent with the use of a small caching proxy server called "polipo".
    Polipo can be found here: http://www.pps.jussieu.fr/~jch/software/polipo/
    I'm not sure if there are precompiled binaries available. I compiled it from source using the gcc environment shipped with xcode by executing "./configure", "make" and "sudo make install".
    To run it at startup i used this plist file:
    ?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>Disabled</key>
        <false/>
            <key>Label</key>
            <string>fr.jussieu.pps.polipo</string>
            <key>ProgramArguments</key>
            <array>
                    <string>/usr/local/bin/polipo</string>
                    <string>-c</string>
                    <string>/etc/polipo.conf</string>
            </array>
            <key>RunAtLoad</key>
            <true/>
        <key>OnDemand</key>
        <false/>
        <key>UserName</key>
        <string>root</string>
        <key>GroupName</key>
        <string>daemon</string>
    </dict>
    </plist>
    i saved it under the name fr.jussieu.pps.polipo.plist in /Library/LaunchDaemons/.
    then i modified the example configuration file from the source package and saved it to /etc/polipo.conf. This is the essential modification to hide the user agent:
    censoredHeaders = user-agent
    There are more options available to censor the Headers and to increase privacy (set-cookie2, cookie2, from, x-pad, link, accept_language).
    after that i started the daemon:
    sudo launchctl load /Library/LaunchDaemons/fr.jussieu.pps.polipo.plist
    at last i configured my proxy settings of osx to my new local proxy for http:
    host: 127.0.0.1
    port: 8118
    that should do it ... i hope this is usefull for someone else ...
    please note: hiding the user-agent or blocking cookies may cause websites not to act normal.

  • File permissions when copied from server

    When a user connects to a share and copies items to their own local desktop, should the permissions on the files stick with them once copied, or should the file permissions be inherited from the location they were copied to?
    Server: OS X Server 10.5.x
    Client: OS X 10.5.x

    Try this you say you are not using ACL's
    Good but wait for it
    Enable ACL to the disk, Do not set ACL permissions
    See what happens

  • How can I repair file permissions?

    Greetings!
    Recently I get this warning when I do a File Permissions Repair with help of Distools:
    `Warning: SUID File `System/Library/CoreServices/RemoteManagement/ARDagentApp/Contents/MacOS/ARDage nt` is changed and cannot be repaired.
    I did a few attempts to repair this file permission by hand and also used Onyx to repair this but when my Mac had a restart are the permissions again change to `only read` and do I get the same Warning.
    Shall I just let it be? Or what can I do to change this?
    With kind regards,
    Silvia

    That warning is on this list http://support.apple.com/kb/TS1448 and as per Apple can be safely ignored.
    Stefan

  • Time Capsule file permissions

    Whenever I copy a file to the time capsule (either via finder by moving it there, or via terminal with cp) the file permissions of the file end up with -rwxrwxrwx, independently whether the file was an executable, or whether it only had reading permissions for all or group. Running chmod on the Time Capsule files has no effect.
    This is really silly and makes the Airport Disk sharing useless. This way I will never share files with my friends over the Airport disk because the files loose their property and all files are executables at the end.
    Is there a way to mount or configure the Time Capsule so that it conserves the file permissions?
    I am aware that time capsule cannot handle different users, but at least it should conserve the file permissions. I imagine it could be like a scp or ftp of files to another server. My files on the other server will not have my user name, but at least they conserve the file permissions. A -rw-r-r- file will still be a -rw-r-r- file even if I copy it 10 times from one server to another.
    I would lik to encourage Apple to take this problem seriously and provide an update for this issue. So many other Apple products are just so well integrated in a networking environment, even if it is a heterogeneous one, but not Time Capsule with this flaw.
    Best wishes,
    Reto

    Agree, this is a serious flaw, that makes the device very dangerous to use as a central server for shared files, for example, the family's photograph collection. Since there appears to be no way to write protect anything, how can I ensure the files don't get modified or deleted?
    Here's a nasty case I am seeing:
    We unload a digital camera onto the TC's disk, then someone goes to their iPhoto app, and adds these files to their iPhoto library. Then they do something simple, like rotate the photos, and voila! The master file on the TC has now been modified! Horrible.

  • How to set all file permissions to default?

    So a few background notes are in order. I came across an article on the NSA's website titled Hardening Tips for Mac OS x 10.6 "Snow Leopard", needless to say I have come to believe I have made this irreversible. The NSA suggested to do some fancy command line coding to disable this, modify that, and change permissions to this. After hours spent on "hardening" my system, I have little hair left to pull in frustration. Is there any way to restore all file permissions back to default? I have used the Repair Disk Permissions, but that has done very little. To give the scope of what permissions have been skewed, I have observed several things:
    The desktop wallpapers, on all Desktops (as I'm in Lion 10.7.3), start from the same picture every time. I have the wallpapers changing, randomly, every 5 minutes.
    Safari doesn't keep the home page. No matter how often I try to change the homepage, I restart Safari, and I'm right back to the original homepage.
    Firefox doesn't retain the fact that I want it to be the default Web Browser. In fact, it keeps "forgetting" that I've used it before, and thus brings me to their awesome start page whenever someone first uses Firefox.
    Spotlight gets "stuck" i.e. almost every time I start my machine, it indexes. Even after I let it finish indexing, the next time I start my computer, it starts again.
    I have to input the administrator password after almost every activity, such as copying to the desktop, moving an application not bought from the Mac App Store into the /Applications folder, deleting a file from anywhere inside my home folder, etc.
    Some preference panes that need access to certain folders, such as Hazel's access to my desktop, are denied that access without ever prompting me for a password (though even if it did, it would get rather annoying after every startup)
    My firewall (in System Preferences>Security & Privacy>Firewall) doesn't "remember" that I do indeed want Dropbox to accept incoming connections. I have to input my admin password at each startup after clicking "allow"
    Opera pretty much doesn't function. Its bookmarking capability, home page, saved tabs, any thing that requires the saving of any type of preference to the computer results in a dialog pop up informing me that Opera failed to save what it needed, and prompts me to "Try again" or "Cancel" (hint: the "Try again" button doesn't work)
    There are more symptoms of an ever growing problem.
    I have backed up my machine from Time Machine, but I think it retains these file permissions, unless I'm wrong.
    Summary:
    How can I fully restore EVERY file permission back to default? Repair Disk Permissions doesn't work
    Is there a way that I can re-install Mac OS X, restore through Time Machine, and achieve the default file permissions, essentially losing all file permissions?

    Repairing the permissions of a home folder in Lion is a complicated procedure. I don’t know of a simpler one that always works.
    Launch the Terminal application by entering the first few letters of its name into a Spotlight search. Drag or copy – do not type – the following line into the window, then press return:
    chmod -R -N ~
    If you get an error message about permissions, enter this:
    sudo !!
    You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning not to screw up.
    Next, boot from your recovery partition by holding down the key combination command-R at startup. Release the keys when you see a gray screen with a spinning dial.
    When the recovery desktop appears, select Utilities ▹ Terminal from the menu bar.
    In the Terminal window, enter “resetpassword” (without the quotes) and press return. A Reset Password window opens.
    Select your boot volume if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select  ▹ Restart from the menu bar.

  • Live Data / Problem with file permissions

    Just trying out an old version of Dreamweaver MX 2004. I am
    using my webhosting service for remote server/testing server
    duties. It is running PHP 4.3.10 and MySQL 3.23.58. I was able to
    set up the database connection and test-retrieve a recordset with
    no problems. In following the tutorial I found that Livedata
    wouldn't work, it just giving me a warning about file permissions
    being wrong. It turns out that when Dreamweaver creates a temporary
    file of the work-in-progress to upload to the remote server the
    file is created on the server with owner=rw, group=rw, world=r
    which explains why it won't run - group has to be set to group=r.
    The file is created on the fly and then immediately deleted by
    Dreamweaver so it is impossible to manually set the permission on
    the server and probably fairly pointless too.
    I tried just saving the file and previewing in the browser
    which again causes it to be uploaded to the remote server. The
    first time this resulted in the browser offering a file download
    box instead of running the page. The reason is - again - that
    Dreamweaver is setting the uploaded file permissions to include
    group=rw. If I manually set the permission for group to group=r it
    runs fine.
    It turns out that Dreamweaver is always setting the file
    permissions on file uploads (checked php and html) to the
    remote/testing server to include group=rw. Once I set it manually
    on the remote/testing server to group=r for a php file everything
    is fine and subsequent uploads of the same file do not change it
    again.
    I checked with the webhosting company and their second-line
    have reported back to me that the default file permission they set
    on uploaded files includes group=r so it must be DW that is causing
    the problem by setting group=rw the first time. I confirmed this by
    using WS-FTP to upload the same file (renamed) to the same target
    directory and the permissions set were owner=rw, group=r, world=r.
    So
    Can anyone please tell me how to change the permissions DW
    sets on files written to a remote server because I have spent
    countless hours on it without success. From looking at other posts
    in this forum it could be that other users are hitting the same
    kind of problem with DW8

    Stop using Live Data with a hosting account. Set up PHP and
    MySQL locally on
    your machine. That is how it's supposed to work. You
    shouldn't test files on
    the fly on a host as you write them. Change your test account
    in DW to use
    the local server. Upload your files to your remote server
    after they are
    fully tested.
    Tom Muck
    http://www.tom-muck.com/
    "nigelssuk" <[email protected]> wrote in
    message
    news:[email protected]...
    > Just trying out an old version of Dreamweaver MX 2004. I
    am using my
    > webhosting
    > service for remote server/testing server duties. It is
    running PHP 4.3.10
    > and
    > MySQL 3.23.58. I was able to set up the database
    connection and
    > test-retrieve a
    > recordset with no problems. In following the tutorial I
    found that
    > Livedata
    > wouldn't work, it just giving me a warning about file
    permissions being
    > wrong.
    > It turns out that when Dreamweaver creates a temporary
    file of the
    > work-in-progress to upload to the remote server the file
    is created on the
    > server with owner=rw, group=rw, world=r which explains
    why it won't run -
    > group
    > has to be set to group=r. The file is created on the fly
    and then
    > immediately
    > deleted by Dreamweaver so it is impossible to manually
    set the permission
    > on
    > the server and probably fairly pointless too.
    >
    > I tried just saving the file and previewing in the
    browser which again
    > causes
    > it to be uploaded to the remote server. The first time
    this resulted in
    > the
    > browser offering a file download box instead of running
    the page. The
    > reason is
    > - again - that Dreamweaver is setting the uploaded file
    permissions to
    > include
    > group=rw. If I manually set the permission for group to
    group=r it runs
    > fine.
    >
    > It turns out that Dreamweaver is always setting the file
    permissions on
    > file
    > uploads (checked php and html) to the remote/testing
    server to include
    > group=rw. Once I set it manually on the remote/testing
    server to group=r
    > for a
    > php file everything is fine and subsequent uploads of
    the same file do not
    > change it again.
    >
    > I checked with the webhosting company and their
    second-line have reported
    > back
    > to me that the default file permission they set on
    uploaded files includes
    > group=r so it must be DW that is causing the problem by
    setting group=rw
    > the
    > first time. I confirmed this by using WS-FTP to upload
    the same file
    > (renamed)
    > to the same target directory and the permissions set
    were owner=rw,
    > group=r,
    > world=r.
    >
    > So
    >
    > Can anyone please tell me how to change the permissions
    DW sets on files
    > written to a remote server because I have spent
    countless hours on it
    > without
    > success. From looking at other posts in this forum it
    could be that other
    > users
    > are hitting the same kind of problem with DW8
    >

  • Problem with file permissions

    Hello all,
    I am making a simple HttpServlet, which takes input
    from html page and saves in to a file, but I'm having a
    bit of a problem with file permissions.
    I'm getting the following exception
    java.security.AccessControlException: access denied (java.io.FilePermission ./data/result read)
         java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
         java.security.AccessController.checkPermission(AccessController.java:427)
         java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
         java.lang.SecurityManager.checkRead(SecurityManager.java:871)
         java.io.File.exists(File.java:700)
         SyksyHTTPServlet.doPost(SyksyHTTPServlet.java:31)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         sun.reflect.GeneratedMethodAccessor52.invoke(Unknown Source)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:585)
         org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
         java.security.AccessController.doPrivileged(Native Method)
         javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)
         org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)The exception seems to occur when I'm trying to check whether the file already
    exists or not.
    The data directory has all permissions (read, write and execute) set for all users,
    and I have made an empty file called result inside the data directory for testing.
    This file has read and write permissions enabled for all users.
    Here's my code
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.Enumeration;
    import java.util.List;
    import java.util.ArrayList;
    public class SyksyHTTPServlet extends HttpServlet
         public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              int totalCount = 0;
              List list;
              String song = request.getParameter("song");
              PrintWriter out = response.getWriter();
              File file = new File("./data/result");
              if(file.exists())  // this is line 31, which seems to cause the exception
                   list = readFile(file);
              else
                   file.createNewFile();
                   list = new ArrayList();
              list.add(song);
              writeFile(file, list);
              for(int i = 0 ; i < list.size() ; i++)
                   out.println(list.get(i));
         public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              doPost(request, response);
         private List readFile(File file)
              List list = null;
              try
                   FileInputStream fis = new FileInputStream(file);
                   ObjectInputStream ois = new ObjectInputStream(fis);
                   list = (ArrayList)ois.readObject();
                   ois.close();
              catch(Exception e)
                   e.printStackTrace();
              return list;
         private void writeFile(File file, List list)
              try
                   FileOutputStream fos = new FileOutputStream(file);
                   ObjectOutputStream oos = new ObjectOutputStream(fos);
                   oos.writeObject(list);
                   oos.flush();
                   oos.close();
              catch(Exception e)
                   e.printStackTrace();
    }I'm using Tomcat 5.5 on Ubuntu Linux, if that has anything to do with this.
    I'll appreciate all help.
    kari-matti

    Hello again.
    I'm still having problems with this. I made
    a simple servlet that reads from and writes
    to text file. The reading part work fine on my
    computer, but the writing doesn't, not even
    an exception is thrown if the file exists that
    I'm trying to write to. If I try to create a new
    file I'll get an exception about file permissions.
    I also asked a friend of mine to try this same
    servlet on his windows computer and it works
    as it should.
    Here's the code
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class ReadServlet extends HttpServlet
         public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              String s = "";
              PrintWriter out = response.getWriter();
              String docroot = getServletContext().getRealPath( "/" );
              out.println("docroot: "+docroot);
              File file = new File(docroot+"test.txt");
              if(file.exists())
                   s = readFile(file);
                   out.println(s);
              else
                   out.println("file not found");
                   //file.createNewFile();                    // causes exception
                   //out.println("new file created.");
              writeFile(file, "written by servlet");
              out.println("Now look in the file "+file.getPath());
              out.println("and see if it contains text 'written by servlet'");
         public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              doPost(request, response);
         private String readFile(File file)
              FileInputStream fis = null;
              BufferedInputStream bis = null;
              DataInputStream dis = null;
              String s = "";
              try
                   fis = new FileInputStream(file);
                   bis = new BufferedInputStream(fis);
                   dis = new DataInputStream(bis);
                   s = dis.readLine();
                   fis.close();
                   bis.close();
                   dis.close();
              catch(Exception e)
                   e.printStackTrace();
              return s;
         private void writeFile(File file, String s)
              FileOutputStream fos = null;
              BufferedOutputStream bos = null;
              DataOutputStream dos = null;
              try
                   fos = new FileOutputStream(file);
                   bos = new BufferedOutputStream(fos);
                   dos = new DataOutputStream(bos);
                   dos.writeChars(s);
                   fos.flush();
                   bos.flush();
                   dos.flush();
                   fos.close();
                   bos.close();
                   dos.close();
              catch(Exception e)
                   e.printStackTrace();
    }And if someone wants to test this servlet I can
    give a war package.
    Any advices?
    kari-matti

Maybe you are looking for

  • Storing on DVD

    If I download a bunch of TV shows from itunes, burn the files to a DVD and delete them from my computer to save space, and load them back to my computer when I want to watch that particular episode, should I run into any problems in terms of being ab

  • Elements Premier: How do i rotate a video without clipping off parts of it?

    Can someone tell me how to do this?  I know how to rotate from the help forums: Rotate a clip Select the clip in the Timeline. In the Effects view, click the Edit Effects button. Expand the Motion effect in the Properties view, and do one of the foll

  • Why is my computer opening docx file in adobe

    When I download a docx file it opens with adobe and It will not open. How can I fix this problem?

  • ITunes start: "Jacket" cannot be loaded in 64-bit version

    On starting iTunes I receive the message above, I have searched my entire system for this "jacket"; I have disabled all plugins (deleted them) and I still get it, does anybody know what's behind this? Possibly Apple Scripts? Anybody else with the sam

  • Hide '1 error has occurred' when validation fires

    Hi All, how to hide '1 error has occurred' message when validation fires? Mixing English and non-English messages looks a bit uncomfortable for users. So I would like to hide or translate it into Russian. How to do this? Thanks