- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- how can I find the file which the hard link file l...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2007 06:19 AM
тАО11-14-2007 06:19 AM
if I do following
$ CREATE FOO.A
$ SET FILE FOO.A/ENTER=FOO.B
which command can find out that FOO.B link to
FOO.A FILE?
Thanks in advance
Lionel
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2007 07:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2007 07:03 AM
тАО11-14-2007 07:03 AM
Re: how can I find the file which the hard link file link to?
alp $ SET FILE FOO.A/ENTER=FOO.B
alp $ dire /file_id foo.*
Directory ALP$DKA0:[SMS]
FOO.A;1 (165974,3853,0)
FOO.B;1 (165974,3853,0)
alp $ define /user DFU$NOSMG do_not_want_it
alp $ dfu search /fid = 165974 sys$disk
Disk and File Utilities for OpenVMS V3.2
%DFU-I-SEARCH, Start search on SYS$DISK: (ALP$DKA0:)
ALP$DKA0:[SMS]FOO.A;1 0/0
%DFU-I-EOF, End of file INDEXF.SYS, Primary headers : 1
%DFU-S-FND , Files found : 1, Size : 0/0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2007 07:08 AM
тАО11-14-2007 07:08 AM
Re: how can I find the file which the hard link file link to?
Lionel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2007 07:17 AM
тАО11-14-2007 07:17 AM
Re: how can I find the file which the hard link file link to?
In case you're wondering what DFU is, you can learn and download it from here:
http://www.digiater.nl/dfu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2007 10:35 AM
тАО11-14-2007 10:35 AM
Re: how can I find the file which the hard link file link to?
That file id identifies a unique file header, which effectively is the file itself. That header has one, and only one, directory backlink (id) which points to where the file was created, ot last renamed into.
The DFU command Steven showed is, IMnsHO, only confusing. It does NOT do what you want.
DFU will scan the headers, looking for the file-id, and then follow the backlink and thus find only 1 occurance, which may or might not be what one might think of as the master.
It's not really the master, all directory entries are the same, but OpenVMS will ATTEMPT to not destroy that master when deleting the alias. Delete the master, and unlike hardlink, the alias will point to nowhere (FNF)
The only way to find all 'links' would be a DIRExx/FILE [000000...] or F$SEARCH equivalent and parse the output looking for matching file id. Tedious, possibly slow, but do-able.
For example:
$ dir/file tmp.tmp
Directory LDA9:[000000]
TMP.TMP;1 (14,1,0)
Total of 1 file
$ perl -e "print grep(/\(14,1,0/,qx(dire/file/nohead/nogra/notrai/wid=fil=50 [000000...]*.*;*))"
LDA9:[000000]TMP.TMP;1 (14,1,0)
LDA9:[B]TMP.TMP;1 (14,1,0)
LDA9:[C]TMP.TMP;1 (14,1,0)
The file creation scenario for that is below.
Enjoy!
Hein.
$ ld connec sys$login:lda9.disk lda9:
$ init lda9: lda9
$ moun lda9: lda9
%MOUNT-I-MOUNTED, LDA9 mounted on...
$ set def lda9:[000000]
$ cre/dir [a]
$ cre/dir [b]
$ cre/dir [c]
$ cre tmp.tmp
test
$ set file/entr=[b] tmp.tmp/log
$ set file/ente=[b] tmp.tmp/log
%SET-I-ENTERED, LDA9:[000000]TMP.TMP;1 entered as LDA9:[B]TMP.TMP;
$ set file/ente=[c] tmp.tmp/log
%SET-I-ENTERED, LDA9:[000000]TMP.TMP;1 entered as LDA9:[C]TMP.TMP;
$ copy tmp.tmp [a]a
$ copy tmp.tmp [a]b
$ copy tmp.tmp [b]p
$ copy tmp.tmp [b]q
$ copy tmp.tmp [c]q
$ dire/file/nohead/nogra/notra/wid=fil=50 [000000...]*.*;*
LDA9:[000000]000000.DIR;1 (4,4,0)
LDA9:[000000]A.DIR;1 (11,1,0)
LDA9:[000000]B.DIR;1 (12,1,0)
LDA9:[000000]BACKUP.SYS;1 (8,8,0)
LDA9:[000000]BADBLK.SYS;1 (3,3,0)
LDA9:[000000]BADLOG.SYS;1 (9,9,0)
LDA9:[000000]BITMAP.SYS;1 (2,2,0)
LDA9:[000000]C.DIR;1 (13,1,0)
LDA9:[000000]CONTIN.SYS;1 (7,7,0)
LDA9:[000000]CORIMG.SYS;1 (5,5,0)
LDA9:[000000]INDEXF.SYS;1 (1,1,0)
LDA9:[000000]SECURITY.SYS;1 (10,10,0)
LDA9:[000000]TMP.TMP;1 (14,1,0)
LDA9:[000000]VOLSET.SYS;1 (6,6,0)
LDA9:[000000]X.TMP;3 (22,1,0)
LDA9:[000000]X.TMP;2 (21,1,0)
LDA9:[000000]X.TMP;1 (20,1,0)
LDA9:[A]A.TMP;1 (15,1,0)
LDA9:[A]B.TMP;1 (16,1,0)
LDA9:[B]P.TMP;1 (17,1,0)
LDA9:[B]Q.TMP;1 (18,1,0)
LDA9:[B]TMP.TMP;1 (14,1,0)
LDA9:[C]Q.TMP;1 (19,1,0)
LDA9:[C]TMP.TMP;1 (14,1,0)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2007 11:52 AM
тАО11-14-2007 11:52 AM
Re: how can I find the file which the hard link file link to?
The correct DFU command is: dfu directory/alias
$ cre/dir disk$demo1g:[a]/own=system
$ cre/dir disk$demo1g:[b]/own=system
$ cre disk$demo1g:[a]z.dat
Exit
$ set file/ent=disk$demo1g:[a]a.dat disk$demo1g:[a]z.dat
$ set file/ent=disk$demo1g:[b]c.dat disk$demo1g:[a]a.dat
$ dfu directory/alias disk$demo1g
Disk and File Utilities for OpenVMS V3.2
%DFU-I-INDSCAN, Making directory table for DISK$DEMO1G: ($1$DGA7325:)
%DFU-I-DIRSCAN, Scanning 7 directories...
$1$DGA7325:[A]A.DAT;1 is alias for $1$DGA7325:[A]Z.DAT;1
$1$DGA7325:[B]C.DAT;1 is alias for $1$DGA7325:[A]Z.DAT;1
%DFU-S-DONE, Directories scanned : 7
$
More extensive details in attachment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-15-2007 09:05 AM
тАО11-15-2007 09:05 AM
Re: how can I find the file which the hard link file link to?
> entries are the same, but OpenVMS
> will ATTEMPT to not destroy that master
> when deleting the alias. Delete the
> master, and unlike hardlink, the alias will
> point to nowhere (FNF)
... and then there is ODS5 with hardlinks, came with the COE version of 7.2: no master,
so you can't easily create a pointer to nowhere.
> The only way to find all 'links' would be
> a DIRExx/FILE [000000...] or
> F$SEARCH equivalent and parse the output
> looking for matching file id.
> Tedious, possibly slow, but do-able.
It's somehow faster on ODS5 with hardlinks: check if the link count is greater than
1 and you have a file ID worth to compare.
mw