Changeset 199


Ignore:
Timestamp:
11/04/02 16:34:28 (20 years ago)
Author:
piso
Message:

writeBuffer(): make sure file is writable before doing anything else.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/j/SystemBuffer.java

    r198 r199  
    33 *
    44 * Copyright (C) 1998-2002 Peter Graves
    5  * $Id: SystemBuffer.java,v 1.10 2002-11-04 15:55:07 piso Exp $
     5 * $Id: SystemBuffer.java,v 1.11 2002-11-04 16:34:28 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    410410    public void writeBuffer() throws SaveException
    411411    {
     412        if (file.isFile() && !file.canWrite()) {
     413            Log.error("writeFile: file is not writable: " + file);
     414            throw new SaveException(file,
     415                                    file.canonicalPath() + " is not writable");
     416        }
    412417        if (Platform.isPlatformWindows()) {
    413418            // writeTemporaryFile() throws a SaveException if an error occurs.
Note: See TracChangeset for help on using the changeset viewer.