--- a/OpenVMSFilename.st Mon Sep 15 23:02:50 1997 +0200
+++ b/OpenVMSFilename.st Mon Sep 15 23:21:43 1997 +0200
@@ -502,6 +502,12 @@
comps directory:'000000'.
].
].
+ "/
+ "/ if it has no suffix, at least append a suffix character
+ "/
+ (f includes:$.) ifFalse:[
+ comps filename:(f , '.')
+ ].
osName := self nameFromComponents:comps.
^ osName
].
@@ -907,5 +913,5 @@
!OpenVMSFilename class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/OpenVMSFilename.st,v 1.4 1997-09-15 20:44:27 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/OpenVMSFilename.st,v 1.5 1997-09-15 21:21:41 cg Exp $'
! !
--- a/Unix.st Mon Sep 15 23:02:50 1997 +0200
+++ b/Unix.st Mon Sep 15 23:21:43 1997 +0200
@@ -901,6 +901,8 @@
struct stat *buffP;
{
int ret;
+ int retry = 0;
+ char t[MAXPATHLEN+1+5];
do {
ret = stat(path, buffP);
@@ -912,11 +914,19 @@
* but only, if it has no extension.
*/
if (strchr(path, '.') != NULL) {
- char t[MAXPATHLEN+1+5];
-
strncpy(t, path, MAXPATHLEN);
t[MAXPATHLEN] = '\0';
strcat(t, ".DIR");
+ retry = 1;
+ } else {
+ if (path[strlen(path)-1] == '.') {
+ strncpy(t, path, MAXPATHLEN);
+ t[MAXPATHLEN] = '\0';
+ strcat(t, "DIR");
+ retry = 1;
+ }
+ }
+ if (retry) {
do {
ret = stat(t, buffP);
} while ((ret < 0) && (errno == EINTR));
@@ -934,6 +944,8 @@
int mode;
{
int ret;
+ int retry = 0;
+ char t[MAXPATHLEN+1+5];
do {
ret = access(path, mode);
@@ -944,11 +956,19 @@
* but only, if it has no extension.
*/
if (strchr(path, '.') != NULL) {
- char t[MAXPATHLEN+1+5];
-
strncpy(t, path, MAXPATHLEN);
t[MAXPATHLEN] = '\0';
strcat(t, ".DIR");
+ retry = 1;
+ } else {
+ if (path[strlen(path)-1] == '.') {
+ strncpy(t, path, MAXPATHLEN);
+ t[MAXPATHLEN] = '\0';
+ strcat(t, "DIR");
+ retry = 1;
+ }
+ }
+ if (retry) {
do {
ret = access(t, mode);
} while ((ret < 0) && (errno == EINTR));
@@ -9641,6 +9661,6 @@
!OperatingSystem class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Attic/Unix.st,v 1.249 1997-09-15 21:00:48 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Attic/Unix.st,v 1.250 1997-09-15 21:21:43 cg Exp $'
! !
OperatingSystem initialize!