[Tutor] OT: How to automate the setting of file permissions for all files in a collection of programs?

Alan Gauld alan.gauld at yahoo.co.uk
Thu Aug 30 04:08:11 EDT 2018


On 30/08/18 04:44, boB Stepp wrote:

> good news side we went from the vi editor to Vim/gVim; from Python 2.4
> to 2.7; in addition to Tkinter there is now a Python interface to GTK;
> went from no SQLite to having it; and a few other goodies that

Hooray!!!

> system installed, SCCS (RIP!) went bye-bye with _nothing_ to replace

Boooo.


> 1)  Using CuteFTP copy all of my original working code (Now with
> problems due to the planning software upgrade.) to my windows PC.
> 2)  Put this code under Git version control.

This should be a one-off operation.

> 3)  Create a development branch.
> 4)  FTP this back to Solaris for code repair, testing, etc. 

Have you installed cygwin (or the Microsoft Linux subsystem)
on your PC? If so have you trioed working on your files on
the PC and only ftp'ing the "working" files to Solaris?

At the very least cygwin would allow you to run X Windows
on your PC and display the Solaris programs on your PC screen.
It should also provide tools like rsync and ssh at the PC end.
(As per Camerons mail, rsync is by far the best tool for
syncing file systems across machines)

> This process has changed all of the Unix file permissions 

That is inherent in using version control systems.

> So before I can do anything further I must go through all of these
> files and change their permissions to the values I need them to be.
> This is quite tedious and error prone.  

I'd opt for a shell script based on the find command
You can of course do it with Python but a shell script
is the more obvious tool for this kind of operation.

> If there is a way in this CuteFTP software to maintain file
> permissions in this back-and-forth transferring between a Windows and

I don't know CuteFTP but rsync definitely can. One of
its zillions of options.

> software package in the Solaris environment, I am not allowed to do
> so.  I am not allowed to use Python pip either.  Strange rules ...

Not that odd in a corporate environment, I was still using
Python 1.3 in 2002 for similar reasons on one of our work
servers.

But there is a 50/5-0 chance the latest Solaris upgrade
will have included rsync.

Even if it hasn't, if you can mount a Solaris drive on your
PC then you can still use rsync from your PC (via cygwin).
Is that an option?

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list