1053 "Created: / 15.6.1996 / 15:22:37 / cg" |
1053 "Created: / 15.6.1996 / 15:22:37 / cg" |
1054 "Modified: / 7.1.1997 / 19:36:11 / stefan" |
1054 "Modified: / 7.1.1997 / 19:36:11 / stefan" |
1055 "Modified: / 11.12.1998 / 16:22:48 / cg" |
1055 "Modified: / 11.12.1998 / 16:22:48 / cg" |
1056 ! ! |
1056 ! ! |
1057 |
1057 |
|
1058 |
1058 !UnixOperatingSystem class methodsFor:'OS signal constants'! |
1059 !UnixOperatingSystem class methodsFor:'OS signal constants'! |
1059 |
1060 |
1060 sigABRT |
1061 sigABRT |
1061 "return the signal number for SIGABRT - 0 if not supported by OS |
1062 "return the signal number for SIGABRT - 0 if not supported by OS |
1062 (the numeric value is not the same across unix-systems)" |
1063 (the numeric value is not the same across unix-systems)" |
3442 "create a new directory with name 'aPathName', which may be an absolute |
3443 "create a new directory with name 'aPathName', which may be an absolute |
3443 path, or relative to the current directory. |
3444 path, or relative to the current directory. |
3444 Return true if successful (or the directory existed already), false if failed. |
3445 Return true if successful (or the directory existed already), false if failed. |
3445 This is a low-level entry - use Filename protocol for compatibility." |
3446 This is a low-level entry - use Filename protocol for compatibility." |
3446 |
3447 |
3447 "/ if it already exists this is ok |
3448 ^ self createDirectory:aPathName withAccess:((self getEnvironment:'UMASK') ? 8r0755) |
3448 |
3449 |
3449 (self isDirectory:aPathName) ifTrue:[^ true]. |
3450 " |
|
3451 OperatingSystem createDirectory:'foo' |
|
3452 " |
|
3453 |
|
3454 "Modified: 20.12.1995 / 11:24:13 / stefan" |
|
3455 "Modified: 29.6.1996 / 14:06:54 / cg" |
|
3456 ! |
|
3457 |
|
3458 createDirectory:aPathName withAccess:umask |
|
3459 "create a new directory with name 'aPathName', which may be an absolute |
|
3460 path, or relative to the current directory. |
|
3461 Return true if successful (or the directory existed already), false if failed. |
|
3462 This is a low-level entry - use Filename protocol for compatibility." |
3450 |
3463 |
3451 %{ |
3464 %{ |
3452 if (__isString(aPathName)) { |
3465 if (__isString(aPathName)) { |
3453 int ret; |
3466 if (__isSmallInteger(umask)) { |
3454 |
3467 int ret; |
3455 ret = mkdir(__stringVal(aPathName), 0755); |
3468 |
3456 if (ret < 0) { |
3469 ret = mkdir(__stringVal(aPathName), __intVal(umask)); |
3457 @global(LastErrorNumber) = __mkSmallInteger(errno); |
3470 if (ret >= 0) { |
3458 RETURN (false); |
3471 RETURN(true); |
3459 } |
3472 } |
3460 RETURN (true); |
3473 @global(LastErrorNumber) = __mkSmallInteger(errno); |
3461 } |
3474 } |
|
3475 } |
3462 %}. |
3476 %}. |
|
3477 "/ if it already existed this is ok |
|
3478 |
|
3479 (self isDirectory:aPathName) ifTrue:[^ true]. |
|
3480 |
3463 |
3481 |
3464 "/ self isUNIXlike ifTrue:[ |
3482 "/ self isUNIXlike ifTrue:[ |
3465 "/ ^ self executeCommand:('mkdir 2>/dev/null ', newPathName) |
3483 "/ ^ self executeCommand:('mkdir 2>/dev/null ', newPathName) |
3466 "/ ]. |
3484 "/ ]. |
3467 "/ ^ self executeCommand:('mkdir ', newPathName) |
3485 "/ ^ self executeCommand:('mkdir ', newPathName) |
3469 self primitiveFailed |
3487 self primitiveFailed |
3470 |
3488 |
3471 " |
3489 " |
3472 OperatingSystem createDirectory:'foo' |
3490 OperatingSystem createDirectory:'foo' |
3473 " |
3491 " |
3474 |
|
3475 "Modified: 20.12.1995 / 11:24:13 / stefan" |
|
3476 "Modified: 29.6.1996 / 14:06:54 / cg" |
|
3477 ! |
3492 ! |
3478 |
3493 |
3479 createFileForReadAppend:pathName |
3494 createFileForReadAppend:pathName |
3480 |
3495 |
3481 ^ self open:pathName attributes:#(O_RDWR O_CREAT O_APPEND) mode:nil |
3496 ^ self open:pathName attributes:#(O_RDWR O_CREAT O_APPEND) mode:nil |