Syntax to change .sav file permissions

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Syntax to change .sav file permissions

Ruben Geert van den Berg
Dear all,
 
I saved a file with read-only permission. Can I undo this with syntax? I tried to save it with '/permissions writeable' but SPSS obviously refuses this.
 
TIA!

Ruben van den Berg
Consultant Models & Methods
TNS NIPO
Email: [hidden email]
Mobiel: +31 6 24641435
Telefoon: +31 20 522 5738
Internet: www.tns-nipo.com



Reply | Threaded
Open this post in threaded view
|

Re: Syntax to change .sav file permissions

J. R. Carroll
Ruben,

I might be missing exactly what is going in your particular situation (if so, please elaborate) but I can effectively alter the read/write permissions by using the PERMISSIONS syntax.  So I cannot recreate what you are describing.

I attempted to do this several ways...

First Attempt:  set 'read only' via syntax - saved datafile - altered the datafile and got an error message when trying to save ('read only is set').  Then I attempted to make the file 'writable' via syntax, and it works fine when trying to save (thus removing the read only permissions).  So. syntax read only and write only work as intended (no surprise here).

Second Attempt:  I went into the document properties via the file in Windows Explorer (Windows 7), marked the file as "read only", opened in SPSS, altered the contents of the datafile (as before) - tried to save it and got an error message saying it was a "read only file" (just like before) - went into syntax told it to make it 'writable' and it effectively removed the 'tick' off the 'read only' option in the files properties in Windows Explorer thus allowing me to save/alter the file freely.  

Be advised:  as per the SPSS help file/syntax guide (v17) it gives the following: 

PERMISSIONS Subcommand (PERMISSIONS command)
PERMISSIONS Subcommand (PERMISSIONS command)

READONLY File permissions are set to read-only for all users. The file cannot be saved by using the same file name with subsequent changes unless the read/write permissions are changed in the operating system or a subsequent PERMISSIONS command specifies PERMISSIONS=WRITEABLE.
 
WRITEABLE File permissions are set to allow writing for the file owner. If file permissions were set to read-only for other users, the file remains read-only for them.

Your ability to change the read/write permissions may be restricted by the operating system.


The underlined part is testament to the behavior I witnessed, and the bold parts may be related to your problem. 

The only things I can think of are:

1.  Are you logged in on your computer as full admin?  or
2.  Did you create the file on one computer and then migrate it over to another workstation (thus simulating 'multiple users')? 

(not sure how either of those alter the ability to mark the file as read/write but that may be what is preventing you).

As a possible workaround I would try removing the 'read only' mark via the file properties directly within Windows (assuming you are using Windows) - then, once you have 'full command' of the file, attempt to open, save, alter, change permissions, etc etc.  The goal here would be to release the file from any 'unseen' permission settings that belong to another 'user' and giving your current workstation the full rights to the file.

Note that I am using the following syntax (I am assuming you are using the exact same thing as per your email):

PERMISSIONS FILE= 'C:\Users\desk\Desktop\Ruben Test\sample.sav'
/PERMISSIONS WRITEABLE.


What error is SPSS giving you? 


HTH,

J. R. Carroll
Grad. Student in Pre-Doc Psychology at CSUS
Research Assistant for Just About Everyone.
Email:  [hidden email]   -or-   [hidden email]
Phone:  (916) 628-4204


On Mon, Aug 23, 2010 at 1:36 AM, Ruben van den Berg <[hidden email]> wrote:
Dear all,
 
I saved a file with read-only permission. Can I undo this with syntax? I tried to save it with '/permissions writeable' but SPSS obviously refuses this.
 
TIA!

Ruben van den Berg
Consultant Models & Methods
TNS NIPO
Email: [hidden email]
Mobiel: +31 6 24641435
Telefoon: +31 20 522 5738
Internet: www.tns-nipo.com




Reply | Threaded
Open this post in threaded view
|

Re: Syntax to change .sav file permissions

Rick Oliver-3
In reply to this post by Ruben Geert van den Berg
The documentation seems to be mistaken on this point, since it says that you can overwrite a read-only file by specifying WRITEABLE on the PERMISSIONS subcommand of a subsequent SAVE command, but it would appear that this does not work. You can, however, change the permissions with the PERMISSIONS command, as in :

data list free /x.
begin data
1 2 3
end data.
save outfile='c:\temp\temp.sav' /permissions=readonly.
*this won't work..
save outfile='c:\temp\temp.sav' /permissions=writeable.
*this will work.
permissions file='c:\temp\temp.sav'
  /permissions writeable.
save outfile='c:\temp\temp.sav'.

The PERMISSIONS command and the various PERMISSIONS subcommands change the operating-system level permissions. So your ability to change those permissions is dependent on what rights you have on that operating system.


From: Ruben van den Berg <[hidden email]>
To: [hidden email]
Date: 08/23/2010 03:38 AM
Subject: Syntax to change .sav file permissions
Sent by: "SPSSX(r) Discussion" <[hidden email]>





Dear all,

I saved a file with read-only permission. Can I undo this with syntax? I tried to save it with '/permissions writeable' but SPSS obviously refuses this.

TIA!

Ruben van den Berg

Consultant Models & Methods

TNS NIPO

Email: [hidden email]

Mobiel: +31 6 24641435

Telefoon: +31 20 522 5738

Internet:
www.tns-nipo.com




Reply | Threaded
Open this post in threaded view
|

Re: Syntax to change .sav file permissions

Ruben Geert van den Berg
Dear Rick and Justin,
 
Thanks, it's working. I was completely unaware of the PERMISSIONS command.

Best,

Ruben van den Berg
Consultant Models & Methods
TNS NIPO
Email: [hidden email]
Mobiel: +31 6 24641435
Telefoon: +31 20 522 5738
Internet: www.tns-nipo.com



 

To: [hidden email]
CC: [hidden email]
Subject: Re: Syntax to change .sav file permissions
From: [hidden email]
Date: Mon, 23 Aug 2010 08:00:01 -0500

The documentation seems to be mistaken on this point, since it says that you can overwrite a read-only file by specifying WRITEABLE on the PERMISSIONS subcommand of a subsequent SAVE command, but it would appear that this does not work. You can, however, change the permissions with the PERMISSIONS command, as in :

data list free /x.
begin data
1 2 3
end data.
save outfile='c:\temp\temp.sav' /permissions=readonly.
*this won't work..
save outfile='c:\temp\temp.sav' /permissions=writeable.
*this will work.
permissions file='c:\temp\temp.sav'
  /permissions writeable.
save outfile='c:\temp\temp.sav'.

The PERMISSIONS command and the various PERMISSIONS subcommands change the operating-system level permissions. So your ability to change those permissions is dependent on what rights you have on that operating system.


From: Ruben van den Berg <[hidden email]>
To: [hidden email]
Date: 08/23/2010 03:38 AM
Subject: Syntax to change .sav file permissions
Sent by: "SPSSX(r) Discussion" <[hidden email]>





Dear all,

I saved a file with read-only permission. Can I undo this with syntax? I tried to save it with '/permissions writeable' but SPSS obviously refuses this.

TIA!

Ruben van den Berg

Consultant Models & Methods

TNS NIPO

Email: [hidden email]

Mobiel: +31 6 24641435

Telefoon: +31 20 522 5738

Internet:
www.tns-nipo.com