The first screenshot is from a lambda in the AWS console. Why all the files are NOT in its own folders? The screenshot is attached. These filers are from python libraries, somehow the files are out of folders.
The second screenshot is how the folders I am expecting. When I unzip the zip file which got developed to AWS, it looks like the second screenshot.
It should show like this in the AWS Lambda console:
You most likely used Windows's Compress-archive or something similar to create the zip file for the lambdas. Since the file separator in Windows and Linux are different, the lambda does not recognize the folder structure correctly, and instead it treats them as long file names.
Try to use, for instance 7-Zip, for zipping the files when you are on Windows. That should fix the file separator issue, since 7-zip uses the cross compatible / as the file separator instead of Windows specific \.
Related
I have a spring boot server hosting a product's file distribution and the product has .exe and .app versions. The .exe file is stored and transmitted without issue but the .app file (created from MacOS and transferred into windows via TeamViewer) is displayed as a folder. The server does not recognize it as a file as well and throws
java.io.FileNotFoundException: source\MyApp.app (Access is denied)
When I create a sample text file and save it as test.app it is treated as a file and not a folder. There is no option to change the folder to a file or method to change it's default opening with explorer. I think it does not care about the .app extension and it treats the .app as file name. I tried to zip it and send to windows but it still doesn't work. See the screenshot for what I mean.
My question is is there any way to change the way windows treats the .app file as a folder? I want it to treat it like a unopenable or raw file.
I solved it by removing the extension and treating it as a normal folder (because .app will not allow Java to read from it and I don't know why). Then I read the contents of the file and made it into a zip archive with the extension 'app' and it works correctly.
I am accepting this as a temporary solution but need to find the cause of this problem.
I'm using the below ansible-playbook code to archive multiple folders under IBM folder.
Below is my absolute path Directory structure:
/app
|-- /IBM
|--/test
|--/log
|--/common
|--/api
|--/<unknown folders>
The number of folders and files under IBM folder is unknown hence it seems impossible to specify all the files / folders under IBM under exclude_path attribute.
I wish to build an archive (gz) that has only IBM folder containing only two folders i.e common and api folders while ignoring the rest of the folders and files.
Thus, I wrote the below playbook:
- name: Creating the archive
archive:
path:
- /was/IBM/common
- /was/IBM/api
dest: /var/backup/mysetup.tar.gz
exclude_path:
- /was/IBM/common/log
- /was/IBM/api/tmp
format: gz
This gives me the archive file mysetup.tar.gz.
I want the mysetup.tar.gz file to have a folder called IBM which should have the two folders common and api. Thus, I'm expecting the below in the mysetup.tar.gz no matter what other files are under the IBM folder.
IBM
|--/common
|--/api
But, the mysetup.tar.gz does not have IBM folder but has common and api folders.
I was not specific hence my question did not get answered here: How to archive multiple folders under one folder using Ansible
Can you please guide me as to how I can get the archive to have both the folders inside the IBM folder inside the mysetup.tar.gz?
Requirement you have can't be achieved straight using archive module. Two specific reasons are listed below:
If you specify the path say /app/IBM then the content of the zip file will have the path after IBM something like common/, api/. To get IBM as a root directory inside the tar.gz file, you need to specify path as /app. This brings to the next point about the usage of exclude_path.
exclude_path doesn't work as you would expect. Say, if the path is define as /app and you want to exclude /app/IBM/test, this wouldn't work. exclude_path works only with direct sub folder/file of a defined path (with wildcard) which means that exclusion of /app/IBM/test would work if path defined as /app/IBM/* but that is not what is expected and brings back the previous point. There is already an issue reported on this topic.
So you probably better off using regular tar command using command/shell module.
I basicaly want to have an external very large (bigger than 2gb) file next to my setup executable. To realize this, in the script I have tried the following:
File "$EXEDIR/verybigfile"
However, I got the following error:
File: "$EXEDIR/verybigfile" -> no files found.
Is it possible to do this in NSIS or do I require a plugin to realize this?
Thanks.
The File instruction cannot use variables like $EXEDIR, it needs the local path on your machine but you will hit the 2 GiB limit because these files are stored inside the installer.
If you are shipping a DVD or something like that you can use CopyFiles /SILENT "$EXEDIR\files\*.*" "$InstDir" to copy files from a DVD to the users system. This instruction does not support any kind of decompression, it is just a plain copy operation.
You need to use a plug-in to extract from .ZIP/.7z files.
I would need to download files or folders from my google drive, via command line.
Thought to a script, a batch file, windows platform.
Seen that I could use gdrive app but I have some troubles with syntax.
I tried:
gdrive-windows-x64.exe download -r --path "G:\My Drive\myfolder"
but it gets me error as "invalid arguments"
Also I'm interested to a way to zip the content of a folder upon my google drive...again via command line
someone can help me?
thanks a lot
marco
Drive is an option.
Create a new folder and do the Initializing setting up;
Create the sub folder mirroring the remote folder structure;
Cd to the sub folder and run $ drive pull
Click here for more pulling documentation.
You have available a Command-line utility for working with Google Drive in github here:
https://github.com/google/skicka
Examples:
skicka download /folder1 ~/folder2
The contents of your ~/folder2 directory will match the contents of ~/folder1.
For download to local:
skicka download /local ~/remote
gdrive is an option written in GoLang. This does require connecting a Google account. This command downloads a Google Drive directory:
gdrive download --recursive DRIVEID
I imported boto3 for my lambda function in python. When i test lambda it gives this error : No module named boto3 which is rather expected.
Then i referred to the docs,to this link to be exact https://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html and realized i need to create a deployment package the issue is i didn't understand the docs well enough to keep up and would like them to be explained again in a simpler way by someone that has already done the required steps.
You need to make a folder in your local system, install the required libraries into that folder, zip the contents of the folder and upload the zipped file to the AWS Lambda.
Make a folder in local system
I don't think you need help in this. Lets suppose you made a folder in D drive named yellow-bot
Install the required libraries into the folder
You can install the required packages in the folder using below command
pip install {package-name} -t "{path-to-project-dir}"
In your case it would be:
pip install apiai -t "D:\yellow-bot"
Zip the contents of the folder
Now after installing the required libraries there will be multiple files and folders in your yellow-bot folder. You need to select all and zip the content. Please note that do not zip the folder, instead you go inside the folder and zip the contents.
It would be something like below screenshot.
Create lambda function and upload zip
Now go to AWS Lambda, create a lambda function, give correct run-time and all that. Then select upload zip file in code entry type. Select your zip and click on upload.
Make sure to give correct Handler.
It follows naming convention as:
The filename.handler-method value in your function. For example,
"main.handler" would call the handler method defined in main.py.
Since in this case I have uploaded connector.py file and entry function was called lambda_handler() so correct Handler would be connector.lambda_handler
Click on Save and you are done.
Hope it helps.