wasCSharpSQLite – Blame information for rev
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | /* |
2 | * PwdCmd.java |
||
3 | * |
||
4 | * This file contains the Jacl implementation of the built-in Tcl "pwd" |
||
5 | * command. |
||
6 | * |
||
7 | * Copyright (c) 1997 Cornell University. |
||
8 | * Copyright (c) 1997 Sun Microsystems, Inc. |
||
9 | * |
||
10 | * See the file "license.terms" for information on usage and |
||
11 | * redistribution of this file, and for a DISCLAIMER OF ALL |
||
12 | * WARRANTIES. |
||
13 | * |
||
14 | * Included in SQLite3 port to C# for use in testharness only; 2008 Noah B Hart |
||
15 | * |
||
16 | * RCS @(#) $Id: PwdCmd.java,v 1.2 1999/05/09 01:12:14 dejong Exp $ |
||
17 | * |
||
18 | */ |
||
19 | using System; |
||
20 | namespace tcl.lang |
||
21 | { |
||
22 | |||
23 | /* |
||
24 | * This class implements the built-in "pwd" command in Tcl. |
||
25 | */ |
||
26 | |||
27 | class PwdCmd : Command |
||
28 | { |
||
29 | |||
30 | public TCL.CompletionCode cmdProc( Interp interp, TclObject[] argv ) |
||
31 | { |
||
32 | if ( argv.Length != 1 ) |
||
33 | { |
||
34 | throw new TclNumArgsException( interp, 1, argv, null ); |
||
35 | } |
||
36 | |||
37 | // Get the name of the working dir. |
||
38 | |||
39 | string dirName = interp.getWorkingDir().ToString(); |
||
40 | |||
41 | // Java File Object methods use backslashes on Windows. |
||
42 | // Convert them to forward slashes before returning the dirName to Tcl. |
||
43 | |||
44 | if ( JACL.PLATFORM == JACL.PLATFORM_WINDOWS ) |
||
45 | { |
||
46 | dirName = dirName.Replace( '\\', '/' ); |
||
47 | } |
||
48 | |||
49 | interp.setResult( dirName ); |
||
50 | return TCL.CompletionCode.RETURN; |
||
51 | } |
||
52 | } // end PwdCmd class |
||
53 | } |