How to change read only file to writeable - spss

Running SPSS 23,
When trying to save a file I get the following error message:
The specified file or directory is read-only and cannot be written to.
The file will not be saved. Save the file with another name or to a
different location or change the access permissions first

First make sure you are trying to write to a directory you have permission to write on - if you gave no path, by default SPSS will write to the SPSS install directory which might require administrator rights.
You can change the default directory for this session by running:
cd "c:\users\santosh\somedirectory"
If this is not enough and you are sure that the file you are trying to write to is not open, try the following syntax:
PERMISSIONS FILE='yourpath\yourfile.sav' /PERMISSIONS WRITEABLE.
And try again.
Please make sure, before you overwrite the existing file, that important information is backed up and safe - if a file was locked for editing, there might be a good reason.

Related

Unrecognized property 'CommType' in connection string using Advantage Data Provider with Entity Framework

I'm trying to set CommType in connection string for Advantage DataBase Server using Entity Framework 5 and Advantage Data Provider in a .NET Web Application.
Connection string is in properties.config file.
I trie to use ads.ini but I don't know where to put it (I try in wwwroot/site/bin but nothing happened)
I need to set this parameters:
RETRY_ADS_CONNECTS = 5
PACKET_SIZE=512
USE_TCP_IP = 1
I can do this whiteout errors, but not using properties.config file.
AdsConnection conn = new AdsConnection("data source=\\\\SERVER1\\DATA; ServerType=remote;TableType=CDX;CommType = TCP_IP");
Any clue about how to solve this? Using ADS.INI or properties.config file, same for me.
Thank you!
Gaston Brave.
You can use the ADS.INI file for this purpose. Where it needs to be located (or how to tell Advantage where to find it) depends on the OS you're using.
From the Advantage Help file topic ADS.INI:
Windows
In order for the ads.ini file to be used, it must be located in the application directory, the Windows directory, the Windows System directory, or the client's search path.
In addition, if an environment variable exists with the name adsini_path, that path will be used to locate the ads.ini file. This can be helpful when you do not want to modify the application’s search path, but still need the ads.ini file to exist in a directory multiple users have rights to (for example on Windows Vista installations). An application can often set the environment variable at run-time before calling any Advantage functions, which avoids the need to set a per-workstation environment variable.
Linux
In order for the ads.ini file to be used, it must be located in the application directory, a directory specified in an environment variable named ADSPATH, in the users home directory, or in the /etc directory. If located in the users home directory the ads.ini file should be named .ads.ini (note the initial "dot").

A non version controlled file or writable file by the same name already exists locally

Trying to get latest version of the project and tfs and always get te same warning without the way of resolving conflict:
When i click the file to resolve it gives me no options to choose
Is there any way to get this around without resorting to cloning whole solution again?
Thanks for help in advance
For this kind error usually due to the file is writable. Take a look at #Buck Hodges (Director of Engineering at Microsoft)'s reply in this case:
The file is writable. When there's a writable file, get will not
overwrite it unless the /overwrite option is used. However, you would
need to figure out how the file is becoming writable. You may want to
go back to the default option of creating a new workspace, and see what is making the file writable.
By default, the system does not retrieve an item if it is writable (that is, if its read-only attribute is cleared) on the client machine. This option overrides the default behavior and overwrites a writable item, unless the item is checked out.
Instead get files directly through Visual Studio. You could try to get files through tf get command line and with /overwrite option. This should do the trick.

Installshield skip custom action if an application is already installed

I have created a basic MSI project which will install few applications on the machine. My first step is to copy few folders and files to the destination machine. Then I have created two custom actions to run the exe files. I would like to skip custom action if that particular application is already installed on the machine. Also while copying the folders and files, I would like to skip if the folder or file already exists on the machine. I tried using install conditions, condition builder, system search but i am unable to resolve it.
Please provide any ideas to resolve these issues. Your answers would be greatly appreciated.
All this can be resolved by using System Search.Refer (http://helpnet.flexerasoftware.com/isxhelp22/helplibrary/NewLaunchCondition.htm)
1) To check if file exists select (File path, by searching folders),enter file name, select directory and assign depth depending on the directory mentioned.
Suppose A.txt is present inside \B\C folder and you are selecting B while searching then depth should be >=2. The property mentioned in this process will get set with the file path if file exists.
2) To check if folder exists select (Folder path, by searching in a specific folder), follow the above procedure and mention folder name instead of filename.
3) To check if application is installed you can check by following one the above processes and find application specific folders/files.
Lastly use the public properties as a condition for your custom actions and components. Suppose you are checking for a file and setting a property ASONFILEFOUND, just mention this in component/custom action condition and those wont run if file exists.
If you still face issues enable windows logging and view the log to check whether properties used in System Search are getting set or not.
Execute-MSI -Action Install -Path 'AcroRead.msi' -Transform 'Settings.mst' -Parameters '/q /norestart' -SkipMSIAlreadyInstalledCheck
use this command. if you are using Powershell for installation.
This will skip the MSI file check.

How to avoid intermittent Errno::ETXTBSY exceptions?

During part of a request in a Rails application, I copy a directory from one place to another, think of it like a working area. Sometimes this copy operation results in "Errno::ETXTBSY" exceptions being thrown. I can't seem to pin down the case that causes it, any tips to detect the case or avoid it altogether?
I've made sure the destination directory is uniquely named, so it shouldn't be a case of 2 processes attempting to write to the same place. Beyond that I'm out of ideas.
ETXTBSY means that you're trying to open for writing a file which is currently being executed as a program, or that you're trying to execute a file which is currently open for writing. Since you say you're copying files, not executing them it seems likely it's the former, not the later.
You say you're targeting a unique new destination, but my guess is that's not entirely true and you're actually targeting an existing directory and one of the files you're attempting to overwrite is currently open as an executable text segment of a running process.
You haven't posted any code, so it's hard to comment specifically. I suggest you add enough logging so you know exactly what file(s) are being processed and specifically, the source and destination path that throws the exception. Then you could use lsof to see what process may have that file open.
One way to avoid the problem if you are overwriting a currently open executable, is to first unlink the target file. The running process will still have the old inode mapped and proceed merrily using the deleted file, but your open for write will then create a new file which won't conflict.

Check if we have write access to a folder? Delphi [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
How can I use Delphi to test if a Directory is writeable?
My program will download an update for the user if they request it. The user has to specify the location to save the installer. They might pick a directory which they don't have access to save something to. In this case the download starts (downloading to a temporary directory I assume) and we only know that it failed when it ends and tries to move the file into the folder.
Is there a simple way to check if we have write permissions on a folder in Delhi?
There is AccessCheck function or tricks, but this information is not reliable in generic case.
So, usually you just need to create file to check, if you have access for that.
For your specific case, you have the following choices:
After save dialog closing: try to
create a file in target folder with
the name of downloading file. Delete
it after check. Not pretty, since
you rarely may have access to create
files, but not to delete them.
After save dialog closing: try to create a
file in target folder with the name
of downloading file. Keep that
handle open and move file content to
it after download is complete. Not
pretty, since you can't move file,
you need to copy it.
(the right one?) Just bring save dialog again
on any access denied issues.

Resources