~ubuntu-branches/ubuntu/intrepid/mit-scheme/intrepid

« back to all changes in this revision

Viewing changes to src/microcode/prosfs.c

  • Committer: Bazaar Package Importer
  • Author(s): Soren Hansen
  • Date: 2007-05-09 10:57:57 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070509105757-p8focimovgqxaaed
Tags: 7.7.90+20070205-1ubuntu1
* Merge from debian unstable, remaining changes:
  * Bootstrapping done via supplied binary package. See log entry for
    7.7.90+20060906-3ubuntu1 for details.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*-C-*-
2
2
 
3
 
$Id: prosfs.c,v 1.18 2003/02/14 18:28:23 cph Exp $
 
3
$Id: prosfs.c,v 1.22 2007/01/12 03:45:55 cph Exp $
4
4
 
5
 
Copyright (c) 1987-2001 Massachusetts Institute of Technology
 
5
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
 
6
    1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 
7
    2006, 2007 Massachusetts Institute of Technology
6
8
 
7
9
This file is part of MIT/GNU Scheme.
8
10
 
18
20
 
19
21
You should have received a copy of the GNU General Public License
20
22
along with MIT/GNU Scheme; if not, write to the Free Software
21
 
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 
23
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
22
24
USA.
23
25
 
24
26
*/
43
45
  PRIMITIVE_RETURN                                                      \
44
46
    ((result == 0)                                                      \
45
47
     ? SHARP_F                                                          \
46
 
     : (char_pointer_to_string ((unsigned char *) result)));            \
 
48
     : (char_pointer_to_string (result)));                              \
47
49
}
48
50
 
49
51
DEFINE_PRIMITIVE ("FILE-EXISTS?", Prim_file_exists_p, 1, 1,
269
271
Otherwise the file did not exist and it was created.")
270
272
{
271
273
  PRIMITIVE_HEADER (1);
272
 
  PRIMITIVE_RETURN
273
 
    (BOOLEAN_TO_OBJECT (OS_file_touch ((CONST char *) (STRING_ARG (1)))));
 
274
  {
 
275
    int rc = (OS_file_touch ((CONST char *) (STRING_ARG (1))));
 
276
    if (rc < 0)
 
277
      error_bad_range_arg (1);
 
278
    PRIMITIVE_RETURN (BOOLEAN_TO_OBJECT (rc));
 
279
  }
274
280
}
275
281
 
276
282
DEFINE_PRIMITIVE ("NEW-DIRECTORY-OPEN", Prim_new_directory_open, 1, 1,