R
Railway13mo 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
Percy13mo ago
Project ID: 8b268cdb-6557-4657-a4ad-5c7aa61441c8
Poui
PouiOP13mo ago
My program is coded in Kotlin and here are the relevant code part : Creation of folders and images :
No description
Poui
PouiOP13mo ago
Extraction of created images and deletion :
No description
Adam
Adam13mo 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
PouiOP13mo 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
Brody13mo ago
you are creating folders and files in the Dropbox cloud?
Poui
PouiOP13mo 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
Brody13mo ago
you likely just have the paths wrong, we have all made this mistake, try using absolute paths instead of relative paths
Poui
PouiOP13mo ago
How can I use absolute paths ? The program works fine and I run the JAR locally, that's what confusing me
Brody
Brody13mo 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
PouiOP13mo 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
Brody13mo ago
also try absolute paths
Poui
PouiOP13mo 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
Brody13mo 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
PouiOP13mo 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
Brody13mo ago
no problem! 🙂
Poui
PouiOP13mo 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
Brody13mo ago
how big is that file
Poui
PouiOP13mo ago
184KB each one is 92 KB
Brody
Brody13mo ago
this screenshot is the root of your project?
Poui
PouiOP13mo ago
I think yes, it's the GitHub repository and in Windows, if I write to "test.txt" and it show there
Brody
Brody13mo ago
is this a typo?
No description
Poui
PouiOP13mo ago
Yeah i wrote that manually, didn't copy paste it
Poui
PouiOP13mo ago
No description
Brody
Brody13mo ago
you are missing the forward slash prefix
Poui
PouiOP13mo ago
"/app/LowercaseDictionnary.txt" ?
Brody
Brody13mo ago
without a prefixed forward slash thats not an absolute path
Poui
PouiOP13mo ago
I will try that now It worked, thanks again
Brody
Brody13mo ago
no problem!
Want results from more Discord servers?
Add your server