Changeset 4437


Ignore:
Timestamp:
10/17/03 17:32:10 (18 years ago)
Author:
piso
Message:

Use Utilities.getFile().

File:
1 edited

Legend:

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

    r4434 r4437  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: open.java,v 1.7 2003-10-17 15:36:31 piso Exp $
     5 * $Id: open.java,v 1.8 2003-10-17 17:32:10 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    3636            throws ConditionThrowable
    3737        {
    38             String namestring;
    39             if (first instanceof LispString)
    40                 namestring = ((LispString)first).getValue();
    41             else if (first instanceof Pathname)
    42                 namestring = ((Pathname)first).getNamestring();
    43             else
    44                 throw new ConditionThrowable(new TypeError(first, "pathname designator"));
     38            File file = Utilities.getFile(first);
    4539            boolean binary = checkBinaryElementType(second);
    46             File file = new File(namestring);
    4740            LispObject ifExists = third;
    4841            if (ifExists == Keyword.SUPERSEDE) {
     
    7770            throws ConditionThrowable
    7871        {
    79             String namestring;
    80             if (first instanceof LispString)
    81                 namestring = ((LispString)first).getValue();
    82             else if (first instanceof Pathname)
    83                 namestring = ((Pathname)first).getNamestring();
    84             else
    85                 throw new ConditionThrowable(new TypeError(first, "pathname designator"));
     72            File file = Utilities.getFile(first);
    8673            boolean binary = checkBinaryElementType(second);
    8774            try {
    8875                if (binary)
    89                     return new BinaryInputStream(new FileInputStream(namestring));
     76                    return new BinaryInputStream(new FileInputStream(file));
    9077                else
    91                     return new CharacterInputStream(new FileInputStream(namestring));
     78                    return new CharacterInputStream(new FileInputStream(file));
    9279            }
    9380            catch (FileNotFoundException e) {
Note: See TracChangeset for help on using the changeset viewer.