Changeset 2316


Ignore:
Timestamp:
Feb 2, 2007, 3:54:42 AM (14 years ago)
Author:
orlov
Message:
  • New library functions: File.Is-Directory? and File.Is-File?.
Location:
to-imperative/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/java/org/refal/plus/library/File.java

    r2067 r2316  
    6464    }
    6565
     66    public static boolean Is_m_Directory_q_ (Expr name) throws RefalException
     67    {
     68        try {
     69            return (new java.io.File(name.toString())).isDirectory();
     70        }
     71        catch (SecurityException _) {
     72            throw new RefalException("File", "Is-Directory?", "Access denied");
     73        }
     74    }
     75
     76    public static boolean Is_m_File_q_ (Expr name) throws RefalException
     77    {
     78        try {
     79            return (new java.io.File(name.toString())).isFile();
     80        }
     81        catch (SecurityException _) {
     82            throw new RefalException("File", "Is-File?", "Access denied");
     83        }
     84    }
     85
    6686    public static boolean Delete (Expr name) throws RefalException
    6787    {
  • to-imperative/trunk/lib/File.rfi

    r2187 r2316  
    99$func? Can-Exec?  e.fname = ;
    1010
     11$func? Is-Directory? e.fname = ;
     12$func? Is-File?      e.fname = ;
     13
    1114$func? Delete     e.fname = ;
    1215
    13 $func Last-Modified e.fname = s.int;
     16$func Last-Modified  e.fname = s.int;
    1417
Note: See TracChangeset for help on using the changeset viewer.