R
Railway8mo ago
Poui

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:
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
Jump to solution
29 Replies
Percy
Percy8mo ago
Project ID: 8b268cdb-6557-4657-a4ad-5c7aa61441c8
Poui
Poui8mo ago
My program is coded in Kotlin and here are the relevant code part : Creation of folders and images :
No description
Poui
Poui8mo ago
Extraction of created images and deletion :
No description
Adam
Adam8mo ago
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?
Poui
Poui8mo ago
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 ?
Brody
Brody8mo ago
you are creating folders and files in the Dropbox cloud?
Poui
Poui8mo ago
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
Brody
Brody8mo ago
you likely just have the paths wrong, we have all made this mistake, try using absolute paths instead of relative paths
Poui
Poui8mo ago
How can I use absolute paths ? The program works fine and I run the JAR locally, that's what confusing me
Brody
Brody8mo ago
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
Poui
Poui8mo ago
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
Brody
Brody8mo ago
also try absolute paths
Poui
Poui8mo ago
I have never used linux or docker before so i don't know what the begining of the absolute path should look like
Solution
Brody
Brody8mo ago
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
Poui
Poui8mo ago
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 😄
Brody
Brody8mo ago
no problem! 🙂
Poui
Poui8mo ago
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 ?
No description
Brody
Brody8mo ago
how big is that file
Poui
Poui8mo ago
184KB each one is 92 KB
Brody
Brody8mo ago
this screenshot is the root of your project?
Poui
Poui8mo ago
I think yes, it's the GitHub repository and in Windows, if I write to "test.txt" and it show there
Brody
Brody8mo ago
is this a typo?
No description
Poui
Poui8mo ago
Yeah i wrote that manually, didn't copy paste it
Poui
Poui8mo ago
No description
Brody
Brody8mo ago
you are missing the forward slash prefix
Poui
Poui8mo ago
"/app/LowercaseDictionnary.txt" ?
Brody
Brody8mo ago
without a prefixed forward slash thats not an absolute path
Poui
Poui8mo ago
I will try that now It worked, thanks again
Brody
Brody8mo ago
no problem!