Get Linux File Attributes

0 Likes

This perl script lists standard information about a file including the attributes that are set. If the attribute it set it is listed. The attributes can include: readOnly, hidden, system, subdirectory, archive, shareable, noSuballoc (no Suballocation), transaction, notVirtual, immediatePurge, renameInhibit, deleteInhibit, copyInhibit, adminLink, link, remoteDataAccess, remoteDataInhibit, compressImmediate, dataStreamCompress, doNotCompress, noStreamCompress, attrArchive (metadata archive bit), or volitile.

It uses the Virtual File Services (Originally called Virtual File Services for NetWare) which were ported over to Linux. The SDK for this API set can be downloaded from http://developer.novell.com/wiki/index.php/Virtual_File_Services_for_NetWare. The objective of the tool is to add a trustee to a file using XML as specified in the VFS for NetWare specification. It is intended to be used as a sample script for developers that may want to use the VFS API set to view and manage storage.



How to Use the file:


linuxGetPoolInfo.pl is a Perl script. So Perl must be installed and running on the Linux server that this file is being loaded on. NSS must be installed to get the VFS support.



To run the perl script type:


perl linuxGetFileAttrInfo.pl /path/file_name.ext <enter>

Where /path/file_name.ext is the fully qualified name of an NSS file including the backslash and the path.



** Note** This only works on NSS files.



Example: perl linuxGetFileAttrInfo.pl /media/nss/NSS1/file.txt <enter>



 Sample output:

rep57:/a # perl linuxGetFileAttrInfo.pl /media/nss/NSS1/file.txt
file is now open
File Name: </_admin/Manage_NSS/files.cmd
Request Sent: <virtualIO><datastream name="command"/></virtualIO><fileRequest><fileInfo><getFileInfo><fileName>/media/nss/NSS1/file.txt</fileName><typeOfInfo><standardInfo/></typeOfInfo></getFileInfo></fileInfo></fileRequest>
<fileReply>
<fileInfo>
<getFileInfo>
<standardInfo>
<volumeName><![CDATA[NSS1]]></volumeName>
<id>157</id>
<parentID>127</parentID>
<logicalEOF>0</logicalEOF>
<physicalEOF>0</physicalEOF>
<attributes><execute/><archive/><attrArchive/></attributes>
</standardInfo>
<result value="0"><description>success</description></result>
</getFileInfo>
</fileInfo>
<result value="0"><description>zOK</description></result>
</fileReply>

Labels:

Collateral
Comment List
Related
Recommended