1
1
package org .perlonjava .perlmodule ;
2
2
3
- import org .perlonjava .runtime .*;
3
+ import org .perlonjava .runtime .RuntimeArray ;
4
+ import org .perlonjava .runtime .RuntimeList ;
5
+ import org .perlonjava .runtime .RuntimeScalar ;
4
6
5
7
import java .io .File ;
6
8
import java .nio .file .Paths ;
@@ -64,7 +66,7 @@ public static void initialize() {
64
66
* Converts a path to a canonical form, removing redundant separators and up-level references.
65
67
*
66
68
* @param args The arguments passed from the Perl environment, where args[1] is the path.
67
- * @param ctx The context in which the method is called.
69
+ * @param ctx The context in which the method is called.
68
70
* @return A {@link RuntimeList} containing the canonical path.
69
71
*/
70
72
public static RuntimeList canonpath (RuntimeArray args , int ctx ) {
@@ -80,7 +82,7 @@ public static RuntimeList canonpath(RuntimeArray args, int ctx) {
80
82
* Concatenates multiple directory names into a single path.
81
83
*
82
84
* @param args The arguments passed from the Perl environment, representing directory names.
83
- * @param ctx The context in which the method is called.
85
+ * @param ctx The context in which the method is called.
84
86
* @return A {@link RuntimeList} containing the concatenated directory path.
85
87
*/
86
88
public static RuntimeList catdir (RuntimeArray args , int ctx ) {
@@ -97,7 +99,7 @@ public static RuntimeList catdir(RuntimeArray args, int ctx) {
97
99
* This method is an alias for {@link #catdir(RuntimeArray, int)}.
98
100
*
99
101
* @param args The arguments passed from the Perl environment, representing file names.
100
- * @param ctx The context in which the method is called.
102
+ * @param ctx The context in which the method is called.
101
103
* @return A {@link RuntimeList} containing the concatenated file path.
102
104
*/
103
105
public static RuntimeList catfile (RuntimeArray args , int ctx ) {
@@ -108,7 +110,7 @@ public static RuntimeList catfile(RuntimeArray args, int ctx) {
108
110
* Returns the current directory symbol.
109
111
*
110
112
* @param args The arguments passed from the Perl environment.
111
- * @param ctx The context in which the method is called.
113
+ * @param ctx The context in which the method is called.
112
114
* @return A {@link RuntimeList} containing the current directory symbol.
113
115
*/
114
116
public static RuntimeList curdir (RuntimeArray args , int ctx ) {
@@ -119,7 +121,7 @@ public static RuntimeList curdir(RuntimeArray args, int ctx) {
119
121
* Returns the null device for the current operating system.
120
122
*
121
123
* @param args The arguments passed from the Perl environment.
122
- * @param ctx The context in which the method is called.
124
+ * @param ctx The context in which the method is called.
123
125
* @return A {@link RuntimeList} containing the null device path.
124
126
*/
125
127
public static RuntimeList devnull (RuntimeArray args , int ctx ) {
@@ -131,7 +133,7 @@ public static RuntimeList devnull(RuntimeArray args, int ctx) {
131
133
* Returns the root directory for the current operating system.
132
134
*
133
135
* @param args The arguments passed from the Perl environment.
134
- * @param ctx The context in which the method is called.
136
+ * @param ctx The context in which the method is called.
135
137
* @return A {@link RuntimeList} containing the root directory path.
136
138
*/
137
139
public static RuntimeList rootdir (RuntimeArray args , int ctx ) {
@@ -143,7 +145,7 @@ public static RuntimeList rootdir(RuntimeArray args, int ctx) {
143
145
* Returns the temporary directory path for the current operating system.
144
146
*
145
147
* @param args The arguments passed from the Perl environment.
146
- * @param ctx The context in which the method is called.
148
+ * @param ctx The context in which the method is called.
147
149
* @return A {@link RuntimeList} containing the temporary directory path.
148
150
*/
149
151
public static RuntimeList tmpdir (RuntimeArray args , int ctx ) {
@@ -158,7 +160,7 @@ public static RuntimeList tmpdir(RuntimeArray args, int ctx) {
158
160
* Returns the parent directory symbol.
159
161
*
160
162
* @param args The arguments passed from the Perl environment.
161
- * @param ctx The context in which the method is called.
163
+ * @param ctx The context in which the method is called.
162
164
* @return A {@link RuntimeList} containing the parent directory symbol.
163
165
*/
164
166
public static RuntimeList updir (RuntimeArray args , int ctx ) {
@@ -169,7 +171,7 @@ public static RuntimeList updir(RuntimeArray args, int ctx) {
169
171
* Filters out the current and parent directory symbols from a list of directory names.
170
172
*
171
173
* @param args The arguments passed from the Perl environment, representing directory names.
172
- * @param ctx The context in which the method is called.
174
+ * @param ctx The context in which the method is called.
173
175
* @return A {@link RuntimeList} containing the filtered directory names.
174
176
*/
175
177
public static RuntimeList no_upwards (RuntimeArray args , int ctx ) {
@@ -187,7 +189,7 @@ public static RuntimeList no_upwards(RuntimeArray args, int ctx) {
187
189
* Determines if the current file system is case-tolerant.
188
190
*
189
191
* @param args The arguments passed from the Perl environment.
190
- * @param ctx The context in which the method is called.
192
+ * @param ctx The context in which the method is called.
191
193
* @return A {@link RuntimeList} containing a boolean indicating case tolerance.
192
194
*/
193
195
public static RuntimeList case_tolerant (RuntimeArray args , int ctx ) {
@@ -199,7 +201,7 @@ public static RuntimeList case_tolerant(RuntimeArray args, int ctx) {
199
201
* Checks if a given file name is an absolute path.
200
202
*
201
203
* @param args The arguments passed from the Perl environment, where args[1] is the file name.
202
- * @param ctx The context in which the method is called.
204
+ * @param ctx The context in which the method is called.
203
205
* @return A {@link RuntimeList} containing a boolean indicating if the path is absolute.
204
206
*/
205
207
public static RuntimeList file_name_is_absolute (RuntimeArray args , int ctx ) {
@@ -215,7 +217,7 @@ public static RuntimeList file_name_is_absolute(RuntimeArray args, int ctx) {
215
217
* Retrieves the system's PATH environment variable as a list of directories.
216
218
*
217
219
* @param args The arguments passed from the Perl environment.
218
- * @param ctx The context in which the method is called.
220
+ * @param ctx The context in which the method is called.
219
221
* @return A {@link RuntimeList} containing the directories in the PATH.
220
222
*/
221
223
public static RuntimeList path (RuntimeArray args , int ctx ) {
@@ -233,7 +235,7 @@ public static RuntimeList path(RuntimeArray args, int ctx) {
233
235
* This method is an alias for {@link #catfile(RuntimeArray, int)}.
234
236
*
235
237
* @param args The arguments passed from the Perl environment, representing path components.
236
- * @param ctx The context in which the method is called.
238
+ * @param ctx The context in which the method is called.
237
239
* @return A {@link RuntimeList} containing the joined path.
238
240
*/
239
241
public static RuntimeList join (RuntimeArray args , int ctx ) {
@@ -244,7 +246,7 @@ public static RuntimeList join(RuntimeArray args, int ctx) {
244
246
* Splits a path into volume, directory, and file components.
245
247
*
246
248
* @param args The arguments passed from the Perl environment, where args[1] is the path and args[2] is optional.
247
- * @param ctx The context in which the method is called.
249
+ * @param ctx The context in which the method is called.
248
250
* @return A {@link RuntimeList} containing the volume, directory, and file components.
249
251
*/
250
252
public static RuntimeList splitpath (RuntimeArray args , int ctx ) {
@@ -281,7 +283,7 @@ public static RuntimeList splitpath(RuntimeArray args, int ctx) {
281
283
* Splits a directory path into its individual components.
282
284
*
283
285
* @param args The arguments passed from the Perl environment, where args[1] is the directory path.
284
- * @param ctx The context in which the method is called.
286
+ * @param ctx The context in which the method is called.
285
287
* @return A {@link RuntimeList} containing the directory components.
286
288
*/
287
289
public static RuntimeList splitdir (RuntimeArray args , int ctx ) {
@@ -301,7 +303,7 @@ public static RuntimeList splitdir(RuntimeArray args, int ctx) {
301
303
* Constructs a complete path from volume, directory, and file components.
302
304
*
303
305
* @param args The arguments passed from the Perl environment, where args[1] is the volume, args[2] is the directory, and args[3] is the file.
304
- * @param ctx The context in which the method is called.
306
+ * @param ctx The context in which the method is called.
305
307
* @return A {@link RuntimeList} containing the constructed path.
306
308
*/
307
309
public static RuntimeList catpath (RuntimeArray args , int ctx ) {
@@ -319,7 +321,7 @@ public static RuntimeList catpath(RuntimeArray args, int ctx) {
319
321
* Converts an absolute path to a relative path based on a given base path.
320
322
*
321
323
* @param args The arguments passed from the Perl environment, where args[1] is the absolute path and args[2] is optional base path.
322
- * @param ctx The context in which the method is called.
324
+ * @param ctx The context in which the method is called.
323
325
* @return A {@link RuntimeList} containing the relative path.
324
326
*/
325
327
public static RuntimeList abs2rel (RuntimeArray args , int ctx ) {
@@ -336,7 +338,7 @@ public static RuntimeList abs2rel(RuntimeArray args, int ctx) {
336
338
* Converts a relative path to an absolute path based on a given base path.
337
339
*
338
340
* @param args The arguments passed from the Perl environment, where args[1] is the relative path and args[2] is optional base path.
339
- * @param ctx The context in which the method is called.
341
+ * @param ctx The context in which the method is called.
340
342
* @return A {@link RuntimeList} containing the absolute path.
341
343
*/
342
344
public static RuntimeList rel2abs (RuntimeArray args , int ctx ) {
0 commit comments