Can't find created files
Hi, I have a program that works locally as expected. It analyses and manipulated some documents and then create screenshot of that documents that it stores inside a folder called "output", the issue is that i am not even sure that the files get created inside that folder when It's deployed.
Here is the project ID : 8b268cdb-6557-4657-a4ad-5c7aa61441c8
Solution:Jump to solution
your code is put into an
/app
folder in the root of the container, so if your project contained a output
folder in the root of project, the absolute path to that folder would be /app/output
29 Replies
Project ID:
8b268cdb-6557-4657-a4ad-5c7aa61441c8
My program is coded in Kotlin and here are the relevant code part :
Creation of folders and images :
Extraction of created images and deletion :
How do you not know if the files are being created? Are there logs that show they aren’t? Are they being saved into a volume?
I am not really sure about that, they are normally created since the files variable isn't null and the dropbox createFolder function run, but the print inside the loop doesn't run
Are they being saved into a volume ?
No, what's a volume ?
you are creating folders and files in the Dropbox cloud?
Inside my program and then I put them in the dropbox cloud
I create a folder inside my program called "output" and I try to put images called "output_1.jpg" and then if the folder inside the program is created, I create a dropbox folder and upload the files to the dropbox cloud
you likely just have the paths wrong, we have all made this mistake, try using absolute paths instead of relative paths
How can I use absolute paths ?
The program works fine and I run the JAR locally, that's what confusing me
you have to keep in mind that on railway your app is ran in a linux docker container, your app has to work in multiple environments
if you only write code with running on windows in mind you will run into problems
oh, can it be an issue with '' for paths ?
the path for windows is output\output_1.jpg
I will try output/output_1.jpg
also try absolute paths
I have never used linux or docker before so i don't know what the begining of the absolute path should look like
Solution
your code is put into an
/app
folder in the root of the container, so if your project contained a output
folder in the root of project, the absolute path to that folder would be /app/output
Thanks !
I will try that now
It worked !! Thanks a lot, I really don't think I would have found this solution alone.
Thanks again 😄
no problem! 🙂
Hi, I don't know if I need to make a new thread for it or not, but it's again a path issue :
I have a file that I commit / push to github, it's in the root of the directory
I tried "LowercaseDictionnary.txt", it didn't work and also "app/LowercaseDictionnary.txt.txt" but my app didn't find it.
Do you have an idea where I can put it and what path I should use to find it ?
how big is that file
184KB
each one is 92 KB
this screenshot is the root of your project?
I think yes, it's the GitHub repository and in Windows, if I write to "test.txt" and it show there
is this a typo?
Yeah i wrote that manually, didn't copy paste it
you are missing the forward slash prefix
"/app/LowercaseDictionnary.txt" ?
without a prefixed forward slash thats not an absolute path
I will try that now
It worked, thanks again
no problem!