- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- How to get file size in symbol var
Operating System - OpenVMS
1748089
Members
4917
Online
108758
Solutions
Forums
Categories
Company
Local Language
юдл
back
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
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
тАО08-22-2009 05:16 AM
тАО08-22-2009 05:16 AM
How to get file size in symbol var
i want to know that how to get a file size in blocks in symbol directly
Can this possible?
If yes , then how? please give me reply..
Can this possible?
If yes , then how? please give me reply..
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-22-2009 05:34 AM
тАО08-22-2009 05:34 AM
Re: How to get file size in symbol var
$ n = f$file("LOGIN.COM","EOF")
$ sho sym n
N = 5 Hex = 00000005 Octal = 00000000005
$ help lex f$file_attributes
$ sho sym n
N = 5 Hex = 00000005 Octal = 00000000005
$ help lex f$file_attributes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-26-2009 03:38 AM
тАО08-26-2009 03:38 AM
Re: How to get file size in symbol var
The answer is, indeed, lexical function F$FileAttributes, but there is more to take into account.
First, you'll need to know what type of file it is: sequential, relative or indexed.
option ORG gives you that answer.
Next, ask yourself what size you are interested in: Allocated (always a multiple of the disk's clsutersize) or the really used space.
Allocated size works regardless organization: Option ALQ will pas that information into the symbol. Bear in mind the result is returned in 512-byte blocks, so if you need to have it in bytes, multiply the value by 512.
REAL size depends on the file's organization.
For seqeuntial files, it can be determined by options EOF and FFB. The first will return the number of fully used 512-byte blocks, the second the offset of the first free byte in the next block: In bytes, the size therefore is (value returned by EOF * 512) + value returned by FFB.
For indexed and relative files, I would recommend usage of allocated size, since calculating the real size is far more complex and will require extra (internal) information that is not easily obtained.
First, you'll need to know what type of file it is: sequential, relative or indexed.
option ORG gives you that answer.
Next, ask yourself what size you are interested in: Allocated (always a multiple of the disk's clsutersize) or the really used space.
Allocated size works regardless organization: Option ALQ will pas that information into the symbol. Bear in mind the result is returned in 512-byte blocks, so if you need to have it in bytes, multiply the value by 512.
REAL size depends on the file's organization.
For seqeuntial files, it can be determined by options EOF and FFB. The first will return the number of fully used 512-byte blocks, the second the offset of the first free byte in the next block: In bytes, the size therefore is (value returned by EOF * 512) + value returned by FFB.
For indexed and relative files, I would recommend usage of allocated size, since calculating the real size is far more complex and will require extra (internal) information that is not easily obtained.
Willem Grooters
OpenVMS Developer & System Manager
OpenVMS Developer & System Manager
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-27-2009 08:48 AM
тАО08-27-2009 08:48 AM
Re: How to get file size in symbol var
There is one restriction with F$FILE_ATTRIBUTES - it can not be used on a file that is opened for exclusive access (no read sharing). If you attempt to you will get the error:
%SYSTEM-W-ACCONFLICT, file access conflict
So in some cases to check a file's size you may have to either have to parse DIRECTORY output, or write your own program that does the same thing.
%SYSTEM-W-ACCONFLICT, file access conflict
So in some cases to check a file's size you may have to either have to parse DIRECTORY output, or write your own program that does the same thing.
I have one, but it's personal.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP