Copying file from one folder to another in laravel causes error File not found - laravel-5.6

i want to copy a file from Modification folder to proposal folder with the file file name store in variable $modfilename but i am getting error file not found at public/files/Modification/abc.pdf
i did not make any changes in filesystem.php ,
Here is my code,
$modfilename=$finalize->modified_proposal;
$modfilename=$modfilename.''.".pdf";
Storage::copy('public/files/Modification/'.$modfilename, 'public/files/Proposal/'.$modfilename);

If your folder has 777 permission and want to create a folder dynamically, you can try creating a folder first and then run the command. It will not give the error.

Related

Stata can't open file saved in local cloud storage folder on Mac

I am using Stata on a Mac. I updated the OS to Monterey today. If I try to open a .dta file---that is saved on my local computer in a folder that syncs to OneDrive---from code in the Do File Editor/Command prompt (where I refer to the file using its full file path), it doesn't open. The error is r(601) - File ... cannot be found.
But if I click on it in Finder, it opens in Stata just fine. After I have done this, I can then open this file in Stata by running the exact same Stata code that didn't work before. Somehow it seems like Stata can't see the file/folder initially, but then it can. I am not sure if this has to do with the OneDrive file/folder permissions or something else.
If, in Stata, I change the directory to the correct directory using cd and then load the file (without referring to the path), it works. However, I would like to be able to refer to the file using the entire file path and not have to change the directory each time.
Interestingly, if I change the directory to the correct directory using Change working directory in the File drop down and then try to load the file using the file path, it also works. But if I do not do the drop down and write out the cd using code, and try accessing the file using the path it doesn't work!
Somehow Stata has to initially "see"/"access" the correct folder (in a very particular way) before being able to access it with the file path. Very strange. (Just to be clear, if I do not change the directory to the correct directory and then try to load the file using its file path, it doesn't work.)
I also tried creating a file using texdoc init... (in a folder that already exists, but that has not been used by Stata before) and get this error:
could not create directory .....
mkdir(): 693 could not create directory
texdoc_mkdir(): - function returned error
texdoc_init(): - function returned error
<istmt>: - function returned error
I do not get this error if I instead use another folder in the same directory that I have previously used.
I think that the error I am encountering is the same or similar to this one (with no acceptable answer): https://answers.microsoft.com/en-us/msoffice/forum/all/onedrive-folder-doesnt-exist/e6b97d47-3f6a-4863-bf68-d3a02832f2bb

How to move a file in the jenkins workspace?

Suppose in the jenkins workspace is a folder named "files", inside the folder is a file named test.xlsx. While building a job i want to move the content of test.xlsx into another file.
i tried:
mv test.xlsx test2.xlsx
but i didnt know where to put this command. Also not sure about the command/path
mv files/test.xlsx files/test.xlsx

unix shell: how to escapte a hidden directory name "."

I am using AIX version 6.1.0.0. I have a hiden directory name like ".sh". When I place the directory name into a variable, I always get a cannot find file error.
file_dir=/opt/.sh/scripts
$file_dir/Find_files.sh $file_dir/file_name
Errors: cat: 0652-050 Cannot open "file_name". A file or directory in the path name does not exist.
I believe the issue is that hidden directory name ".sh". How can I go around this issue?
Without knowing the permissions on the file, directory, subdirs and which user your using its hard to be a 100% sure. But related information about this error states the following:
Possible Causes
1. This error message may be displayed during a backup operation.
2. The system looked for a file that either does not exist or was specified incorrectly.
3. The system looked for a file for which you do not have write permission.
Personally I think its a permission issue with your directory or subdir, so make sure you have the correct access or ownership.

Knife command works from one particular directory but not from others. why?

I have created an organization called "kaushikinc" on chef server and have a directory structure "C:/x/y/z/kaushikinc".
When I execute a command from kaushikinc folder, they work fine but when I execute from a parent or child folder, they dont work. What am I doing wrong?
Ex: from a child folder: No success or error message:
But a success when I try from kaushikinc folder
Edit: Adding a new image to show that the problem exists even when I pass the location of knife.rb config file
Edit2: I run across this problem only when I use "--all" option on "knife data bag from file" command. I am able to execute any other command from any directory with -c enabled.
Usually, this is because the directory you're in, or a parent directory, contains a .chef directory. knife searches for .chef in:
./.chef (current directory contains .chef)
~/.chef (homedir contains .chef)
parent directories (e.g. ./.. then ./../.. all the way back to /)
You can see some of the logic itself here.

Batch Command to Copy Group Policy User Files to Sub-Folder with Unknown Name

I'm working on a project where I need to sysprep a windows 7 image. I need to create a batch script to delete the existing files and sub folders inside another folder with an unknowable name located within the windows/system32/GroupPolicyUsers folder and then copy the needed user policies back into the windows/system32/GroupPolicyUsers/unkownFolderName folder and finally run gpupdate /force.
There is only a single sub folder in the /windows/system32/GroupPolicyUsers folder, but the name of that folder changes to the SID of the user after sysprep which is why I cannot know the exact name of the folder.
Inside this folder having the unknown name there is one sub folder and one file that needs to be deleted and replaced with my own folder and file.
Is this possible using a batch script?
Thanks in advance for your replies...

Resources