forum.vmspython.org Forum Index forum.vmspython.org
Forum system
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Accessing file versions from vmspython

 
Post new topic   Reply to topic    forum.vmspython.org Forum Index -> Python for OpenVMS
View previous topic :: View next topic  
Author Message
EisW



Joined: 07 Dec 2016
Posts: 4

PostPosted: Tue Aug 29, 2017 12:47 pm    Post subject: Accessing file versions from vmspython Reply with quote

I'am using vmspython for some small automation procedures. The Ptd Module works fine.

Neverteheless I would like to know, if there is an "builtin" method to access filenames with its VMS version? Something equivalent to os.listdir (which gives only the file with the highest version); or even better the functionality of VMS lexcials f$search, f$parse?

Best regards
Tino
Back to top
View user's profile Send private message
EisW



Joined: 07 Dec 2016
Posts: 4

PostPosted: Tue Aug 29, 2017 1:39 pm    Post subject: Reply with quote

How can I read a previous versions of file?

open('somefile.txt;-1', 'r') or equivalent will not work ...
Back to top
View user's profile Send private message
EisW



Joined: 07 Dec 2016
Posts: 4

PostPosted: Tue Aug 29, 2017 2:32 pm    Post subject: Access file versions Reply with quote

Answering myself: as I have found in the OpenVMS C RTL reference the following applies to os.listdir() too:

If mask is given in unis style os.listdir('.'), the result is a list of all fields without version numbers

>>> os.listdir('.')
['somefile.txt']

But if I use OpenVMS syntax, I get all file versions (uppercase):

>>> os.listdir('[]')
['SOMEFILE.TXT;1', 'SOMEFILE.TXT;2']

The same applies to open(<filename>) ...

So all works fine Smile

But if you read til here: is there some conversion tool for VMS-Style path expressions to Posix/Linux-Style and reverse?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vmspython.org Forum Index -> Python for OpenVMS All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group