When I create a file in centos using java,
File file= new File("file.txt"),
it creates a directory with the name file.txt. When I manually created a file in the directory so that atleast it overwrites the existing file and identifies it as a file, it is not able to overwrite.It says file already exits as a result of which it stops writing into the file.
Related
I'm trying to add a configuration file in /usr/share/logstash/config inside a docker run by kubernetes , I console onto the docker using $ kubectl exe -it "docker_name" -- /bin/bash.
I create then a .conf file in /usr/share/logstash/config/ , but when try to save the configurations it give me an error :
pipeline/input main.conf E166: Cant open linked file for writing.
I'm not sure if what I'm doing is right in beginning or there should be some better way to achieve this ?
Error E166 Can't open linked file for writing
You are trying to write to a file which can't be overwritten, and the file is a link (either a hard link or a symbolic link). Writing might still be possible if the directory that contains the link or the file is writable, but Vim now doesn't know if you want to delete the link and write the file in its place, or if you want to delete the file itself and write the new file in its place. If you really want to write the file under this name, you have to manually delete the link or the file, or change the permissions so that Vim can overwrite
You should use a ConfigMap to change the configfile
I have a directory upload issue in Prepros 6.1.1, with SFTP only.
This may be related to that question: Folders uploading in Prepros
The file upload is OK, but Prepros will create directories in the wrong path!
Example
I want to upload new-directory/new-file to /home/myuser/www/:
If new-directory exists on the server ; no problem, the file is uploaded in there.
If I upload a new file in a new directory ;
Prepros will create the directory in /home/myuser/home/myuser/www/new-directory,
then try to upload the file to /home/myuser/www/new-directory which doesn't exists…
Does anyone have found a workaround?
How is your FTP config?
Open FTP Settings and on Remote Path yout insert all the path to the directory you want. For example:
I want to upload a file to my test folder, then, on the remote path field, i will insert
/public_html/test/
This way all the files will be uploaded to this directory
I try to upload file to my jenkins machine.
I try to use the File Parameter option, and put in the File location line:/opt/myFolder.
I wish that if I'll choose a.txt file from my local machine, then it will be uploaded to /opt/myFolder/a.txt.
But it gives me an error: FATAL: /opt/myFolder (Is a directory)
How can I fix it?
See my answer here, How to upload a .xlsx file to jenkins job. Basically the name you enter in the File Parameter setting will be the name of the file, so in your case you have set File location to be /opt/myFolder, however it should be the actual file location, so /opt/myFolder/a.txt. This do however mean that the file will have the same name each time.
And as Christopher Orr points out in the comments, the file location should be a relative URL so that it is loaded into the workspace, that way it won't hinder you from running jobs in parallel and on different machines.
Looking at the AWSS3GetPreSignedURLRequest class, I don't see any way to specify a directory in my bucket.
For example, there is a directory images inside my bucket and a file named "first.png". I can set the key to "first.png" but that would only work if the file is on root directory of my bucket.
When I try to set the key to "images/first.png", it does not work either. How do I target files inside a directory using AWSS3GetPreSignedURLRequest?
Thanks
I am trying to write a file to a directory within the WWW directory of my Cordova app.
Here is the situation:
My program saves an image to the temporary directory
I want the program to move the image from the temporary directory to the WWW directory, so that the file does not get deleted every time the app is initialized.
Is this possible?
Thanks.
No that's not possible. The WWW is sandboxed and therefore, you can't write anything inside of this folder. If you want to save a file you need to use the DOCUMENTS path and rely on the Cordova file plugin (PERSISTENT is the keyword)
https://github.com/apache/cordova-plugin-file/blob/master/doc/index.md
You can also check the folder permissions here:
https://github.com/apache/cordova-plugin-file/blob/master/doc/index.md#ios-file-system-layout
As you can see, www is read-only (not r/w)