Advertisement
Guest User

Untitled

a guest
Feb 5th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. int main(int argc, char *argv[])
  2. {
  3. char theFilePath[512];
  4. char theIP[20];
  5. char theFile[100];
  6. char password[1];
  7. char username[10];
  8.  
  9. printf("Username: ");
  10. scanf("%s" , &username);
  11.  
  12. printf("Enter password: ");
  13. scanf("%s", &password);
  14.  
  15. printf("Enter IP: ");
  16. scanf("%d" , &theIP);
  17.  
  18. printf("Please specify the file: ");
  19. scanf("%s" , &theFile);
  20.  
  21. strcat(theFilePath, "./passfiles/");
  22. strcat(theFilePath, theFile);
  23. strcat(theFilePath,".pf");
  24. sprintf(theFilePath,"%s",theFilePath);
  25.  
  26.  
  27. if (!(file_exist (theFilePath)))
  28. {
  29. printf("The file cannot be found in the path %s", theFilePath);
  30. exit(EXIT_FAILURE);
  31. } else
  32. {
  33. printf("The file exists!");
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement