Changeset 3693


Ignore:
Timestamp:
Apr 14, 2008, 6:38:17 PM (13 years ago)
Author:
yura
Message:
  • In some functions Expr.toString() replaced by Expr.toChars().
Location:
to-imperative/trunk/java/java/refal/plus
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/java/java/refal/plus/Dos.java

    r3423 r3693  
    6363    @RefalFormat("$func GetEnv e.VarName = e.Value;")
    6464    public static void GetEnv (Expr var, Result value) {
    65         java.lang.String s = System.getenv(var.toString());
     65        java.lang.String s = System.getenv(var.toChars().toString());
    6666        if (s != null)
    6767            value.assign(s);
  • to-imperative/trunk/java/java/refal/plus/File.java

    r3423 r3693  
    3232    public static boolean Exists (Expr name) throws RefalException {
    3333        try {
    34             return (new java.io.File(name.toString())).exists();
     34            return (new java.io.File(name.toChars().toString())).exists();
    3535        } catch (SecurityException _) {
    3636            throw new RefalException("File", "Exists", "Access denied");
     
    4141    public static boolean CanRead (Expr name) throws RefalException {
    4242        try {
    43             return (new java.io.File(name.toString())).canRead();
     43            return (new java.io.File(name.toChars().toString())).canRead();
    4444        } catch (SecurityException _) {
    4545            throw new RefalException("File", "CanRead", "Access denied");
     
    5050    public static boolean CanWrite (Expr name) throws RefalException {
    5151        try {
    52             return (new java.io.File(name.toString())).canWrite();
     52            return (new java.io.File(name.toChars().toString())).canWrite();
    5353        } catch (SecurityException _) {
    5454            throw new RefalException("File", "CanWrite", "Access denied");
     
    6161        // Meanwhile just check that the file exists.
    6262        try {
    63             String s = name.toString();
     63            String s = name.toChars().toString();
    6464            if (!(new java.io.File(s)).exists())
    6565                return false;
     
    7676    public static boolean IsDirectory (Expr name) throws RefalException {
    7777        try {
    78             return (new java.io.File(name.toString())).isDirectory();
     78            return (new java.io.File(name.toChars().toString())).isDirectory();
    7979        } catch (SecurityException _) {
    8080            throw new RefalException("File", "IsDirectory", "Access denied");
     
    8585    public static boolean IsFile (Expr name) throws RefalException {
    8686        try {
    87             return (new java.io.File(name.toString())).isFile();
     87            return (new java.io.File(name.toChars().toString())).isFile();
    8888        } catch (SecurityException _) {
    8989            throw new RefalException("File", "IsFile", "Access denied");
     
    9494    public static boolean Delete (Expr name) throws RefalException {
    9595        try {
    96             return (new java.io.File(name.toString())).delete();
     96            return (new java.io.File(name.toChars().toString())).delete();
    9797        } catch (SecurityException _) {
    9898            throw new RefalException("File", "Delete", "Access denied");
     
    103103    public static void LastModified (Expr name, Result res) throws RefalException {
    104104        try {
    105             res.assign(BigInteger.valueOf(new java.io.File(name.toString()).lastModified()));
     105            res.assign(BigInteger.valueOf(new java.io.File(name.toChars().toString()).lastModified()));
    106106        } catch (SecurityException _) {
    107107            throw new RefalException("File", "LastModified", "Access denied");
  • to-imperative/trunk/java/java/refal/plus/StdIO.java

    r3682 r3693  
    3939            String m = mode.at(0).toString();
    4040            if (m.equalsIgnoreCase("r"))
    41                 ((Channel) channel.at(0)).openFileReader(fname.toString());
     41                ((Channel) channel.at(0)).openFileReader(fname.toChars().toString());
    4242            else if (m.equalsIgnoreCase("w"))
    43                 ((Channel) channel.at(0)).openFileWriter(fname.toString(), false);
     43                ((Channel) channel.at(0)).openFileWriter(fname.toChars().toString(), false);
    4444            else if (m.equalsIgnoreCase("a"))
    45                 ((Channel) channel.at(0)).openFileWriter(fname.toString(), true);
     45                ((Channel) channel.at(0)).openFileWriter(fname.toChars().toString(), true);
    4646            else
    4747                return false;
     
    182182    @RefalFormat("$func? EraseFile e.FileName = ;")
    183183    public static boolean EraseFile (Expr fname) {
    184         return new File(fname.toString()).delete();
     184        return new File(fname.toChars().toString()).delete();
    185185    }
    186186
  • to-imperative/trunk/java/java/refal/plus/System.java

    r3423 r3693  
    4646    public static void System (Expr cmd, Result res) throws RefalException {
    4747        try {
    48             Process p = Runtime.getRuntime().exec(cmd.toString());
     48            Process p = Runtime.getRuntime().exec(cmd.toChars().toString());
    4949            new Thread(new CmdOutputCatcher(p.getInputStream())).start();
    5050            new Thread(new CmdOutputCatcher(p.getErrorStream())).start();
Note: See TracChangeset for help on using the changeset viewer.