I have a code which takes in three arguments in the form of three folders each consisting of multiple .txt files and these folders lie in a folder named data. When i try to run the executable with the three folder names in cmd, like this "spamfilter mail spam nonspam", i get the aforementioned error. Is there a specific way of telling the system where the folders i want lie?
#Command line "system cannot find path specified"
27 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
relative paths like mail or spam use the current working directory as the base folder
if you're running from cmd.exe, that's the folder that you're currently in
and you can use cd to change between directories
yeah ive done that
so just make sure that you're in the same folder as mail and spam when you run the program
ive changed to the directory which the executable lies
thats the thing, they lie in a folder data that contains those three and im not sure if it manages to find them
the executable can be anywhere you want, what matters is the working directory and the files you're accessing
so you have to start the program while your working directory is C:/.../data
hmmm alright ill try it
yeah it says
data>spamfilter spam nonspam mail
'spamfilter' is not recognized as an internal or external command,
operable program or batch file.
yeah you might have write spamfilter.exe
or provide a more detailed path if the exe isn't in the same directory
where is the program relative to data
what's the absolute path of these files/folders
its called "setoppgave" and it just contains three folders "data" "src" "include" and the executable for spamfilter
so the relative path would be ..\spamfilter.exe
and that should let you run the program while you're in data
yeah now its different but same problem, this time it appears to be some function that struggles with finding the files
`char spamdir = argv[1];
charnonspamdir = argv[2];
char maildir = argv[3];
list_t *spamfiles = find_files(spamdir);
list_t *nonspamfiles = find_files(nonspamdir);
list_t *mails = find_files(maildir);
`
the same error appears in the find_files functions, is there osme function i can use to find out what lies inside the directories?
wait nvm i think i found the problem
How to Format Code on Discord
Markup
```cpp
int main() {}
```
Result
int main() {}
This question thread is being automatically closed. If your question is not answered feel free to bump the post or re-ask. Take a look at !howto ask for tips on improving your question.