OpenVMS
1763764 會員
3842 線上
108917 解決方案
發表新文章

為什麼可以create dir ,但是卻無法login 該目錄

 
watermelonyu
教授

為什麼可以create dir ,但是卻無法login 該目錄

下列是我的問題,我用system user login

去create 一個目錄 ,SET DEF 卻告訴我

directory not found

但是到實體目錄touch 一個檔案後就可以login了,請問這是為什麼呢?

Welcome to OpenVMS (TM) Alpha Operating System, Version V7.3-2



Username: system

Password:

Welcome to OpenVMS (TM) Alpha Operating System, Version V7.3-2

Last interactive login on Thursday, 12-APR-2007 17:43:51.80

Last non-interactive login on Thursday, 12-APR-2007 17:24:07.97

$ sh def

SYS$SYSROOT:

= SYS$SYSROOT:

= SYS$COMMON:

$ create/dir

$ dir test123.dir



Directory SYS$SYSROOT:



TEST123.DIR;1



Total of 1 file.

$ set def

$ dir

%DIRECT-E-OPENIN, error opening SYS$COMMON:*.*;* as input

-RMS-E-DNF, directory not found

-SYSTEM-W-NOSUCHFILE, no such file



$ set def sys$sysdevice:

$ dir test123.dir



Directory SYS$SYSDEVICE:



TEST123.DIR;1



Total of 1 file.

$ set def

$ dir

%DIRECT-W-NOFILES, no files found

$ copy nl: test123.log

$ dir



Directory SYS$SYSDEVICE:



TEST123.LOG;1





Welcome to OpenVMS (TM) Alpha Operating System, Version V7.3-2



Username: system

Password:

Welcome to OpenVMS (TM) Alpha Operating System, Version V7.3-2

Last interactive login on Thursday, 12-APR-2007 19:29:58.88

Last non-interactive login on Thursday, 12-APR-2007 17:24:07.97

$ set def

$ dir



Directory SYS$SYSROOT:



TEST123.LOG;1



Total of 1 file.
1則回覆 1
watermelonyu
教授

為什麼可以create dir ,但是卻無法login 該目錄

這是因為 directory path 使用了 logical name search list.

不同的 DCL 命令在處理 logical name search list 時若遇到 exceptions 會有不同處理方式!



The logical name SYS$SYSROOT is defined as a search list that points first to

a local root (SYS$SYSDEVICE:) and then to the common root

(SYS$COMMON:). Thus, the logical names for the system directories

(SYS$SYSTEM, SYS$LIBRARY, SYS$MANAGER, and so forth) point to two

directories.



$ sh def

SYS$SYSROOT:

= SYS$SYSROOT:

= SYS$COMMON:

$ sh log SYS$SYSROOT

"SYS$SYSROOT" = "A800$DKA0:" (LNM$SYSTEM_TABLE)

= "SYS$COMMON:"

1 "SYS$COMMON" = "A800$DKA0:" (LNM$SYSTEM_TABLE)

$ sh log sys$sysdevice

"SYS$SYSDEVICE" = "A800$DKA0:" (LNM$SYSTEM_TABLE)

$



$! test.dir will be created in the first directory in the logical name search list,

$! in this case it is created in A800$DKA0:

$ create/dir



$! dir looks at both directires, found one test.dir

$ dir test.dir



Directory SYS$SYSROOT:



TEST.DIR;1



Total of 1 file.

$ set def

$ sh def

SYS$SYSROOT:

= SYS$SYSROOT:



$! dir look at A800$DKA0: first but no file found,

$! it then continue look at SYS$COMMON: but found

$! the directory does not exist, so it complains.

$ dir

%DIRECT-E-OPENIN, error opening SYS$COMMON:*.*;* as input

-RMS-E-DNF, directory not found

-SYSTEM-W-NOSUCHFILE, no such file

$



$! ed will check if test.log already exist. Because no file found in

$! A800$DKA0:, it continue look at

$! SYS$COMMON: but found the directory does not exist, so it complains.

$ ed test.log

%EDT-F-OPENIN, error opening SYS$COMMON:TEST.log; as input

-RMS-E-DNF, directory not found

-SYSTEM-W-NOSUCHFILE, no such file

$



$! No problem for the copy