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

2018-08-30 Thread Alan Gauld via Tutor
On 30/08/18 10:30, Cameron Simpson wrote:

>> That is inherent in using version control systems.
> 
...> state.  Personally I use mercurial which does include the
permissions in the
> state.

Ah, interesting. I've never found a VC system that preserved
permissions. Usually they zap everything to read-only on
first export. Then change them to read-write when you
check out etc, then back to read-only on checkin. I never
assume anything about permissions from a VC system and
always set them as they should be in the make file
or installer.

> But there's also the issue of Windows permissions versus UNIX permissions.

Very true aqnd that varies by file system too. (FAT v NTFS etc)

> If he can mount a Solaris drive (NFS or SMB) he can just copy the files :-)

Yes, but rsync will ensure only the changed files get copied.
Although I think DOS XCOPY can maybe do that too, which might
be another 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


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


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

2018-08-30 Thread Cameron Simpson

On 30Aug2018 09:08, Alan Gauld  wrote:

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

[...]

4)  FTP this back to Solaris for code repair, testing, etc.

[...]

This process has changed all of the Unix file permissions


That is inherent in using version control systems.


Not really. I suspect FTP may not be preserving permissions across the transfer 
(no proof though).  But git doesn't preserve file permissions as pat of the 
state.  Personally I use mercurial which does include the permissions in the 
state.


But there's also the issue of Windows permissions versus UNIX permissions.

[...]

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


CuteFTP's web site says it can use SFTP (ssh's ftp-ish protocol, which can 
preserve permissions). https://www.globalscape.com/cuteftp



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


The option is -p (permissions).


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?


If he can mount a Solaris drive (NFS or SMB) he can just copy the files :-)

Cheers,
Cameron Simpson 
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


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

2018-08-30 Thread Alan Gauld via Tutor
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

B.


> 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


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


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

2018-08-29 Thread Cameron Simpson

On 29Aug2018 22:44, boB Stepp  wrote:

So as to not lose the benefits of a version control system, I have
installed Git on my windows PC.  My current workflow now has gotten
more complex, and I'm sure can be improved by those thinking more
clearly than I (And surely more knowledgeable!), and is as follows:

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.
3)  Create a development branch.
4)  FTP this back to Solaris for code repair, testing, etc.  BUT!
This process has changed all of the Unix file permissions on what are
(For me.) many files, some planning system proprietary scripting
files, some Perl files, some shell script files and some Python files.
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.  So I wish to either fix the
process, or, failing that, automate the process of correcting the file
permissions.

If there is a way in this CuteFTP software to maintain file
permissions in this back-and-forth transferring between a Windows and
Solaris environment, I have yet to find it in the software's help
(Though I have not yet had much time to invest in this search, so I
may not have found it yet.).

It occurs to me that in theory it should be possible to automate this
either with a shell script or a Python program.

Is there a standard way of handling this sort of thing?  Bear in mind
that if a typical solution would require the installation of a
software package in the Solaris environment, I am not allowed to do
so.  I am not allowed to use Python pip either.  Strange rules ...


Does rsync exist on your Solaris system? Can you get rsync and ssh on your 
Windows system?


The "standard" UNIX solution to reproduce a directory somewhere is rsync these 
days, which will work over ssh (by default) if the target is remote.


IIRC, git doesn't track file permissions, so you can't just "export" from your 
WIndows git (or some mirror elsewhere).


So: do you have rsync? Do you have ssh from your PC to the Solaris box?

Cheers,
Cameron Simpson 
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


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

2018-08-29 Thread boB Stepp
At work I have accumulated a motley collection of programs I have
written since I started around 2012.  These all run on the Solaris OS.
As long-time readers of my past ramblings may recall, I am not allowed
to install any outside programs on this Solaris system, but I am
allowed to write my own programs to my heart's content, using only
whatever programming-related tools that happen to be installed on a
rather bare-bones OS install.  We have just recently completed
upgrades on hardware, Solaris and treatment planning software.  On the
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
currently slip my mind.  But on the bad side the only version control
system installed, SCCS (RIP!) went bye-bye with _nothing_ to replace
it.  And as usual the radiation therapy planning software we use was
upgraded from version 9.10 to 16.2, breaking several of my programs,
requiring updates on my part that I recently completed.

So as to not lose the benefits of a version control system, I have
installed Git on my windows PC.  My current workflow now has gotten
more complex, and I'm sure can be improved by those thinking more
clearly than I (And surely more knowledgeable!), and is as follows:

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.
3)  Create a development branch.
4)  FTP this back to Solaris for code repair, testing, etc.  BUT!
This process has changed all of the Unix file permissions on what are
(For me.) many files, some planning system proprietary scripting
files, some Perl files, some shell script files and some Python files.
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.  So I wish to either fix the
process, or, failing that, automate the process of correcting the file
permissions.

If there is a way in this CuteFTP software to maintain file
permissions in this back-and-forth transferring between a Windows and
Solaris environment, I have yet to find it in the software's help
(Though I have not yet had much time to invest in this search, so I
may not have found it yet.).

It occurs to me that in theory it should be possible to automate this
either with a shell script or a Python program.

Is there a standard way of handling this sort of thing?  Bear in mind
that if a typical solution would require the installation of a
software package in the Solaris environment, I am not allowed to do
so.  I am not allowed to use Python pip either.  Strange rules ...

-- 
boB
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor