am writing a java code that needs to save a file.
the below code is for mac.
ImageIO.write(movie_image, “jpg”,new File(“/Users/sathyap/Desktop/movieimages/”+fileName+”.jpg”));
is there a way i can give the directory structure “/Users/sathyap/Desktop/movieimages/”
hardcoded that works for both mac and windows.
Assuming that the program runs under a directory (X) in either Mac and Windows. You can code it like this:
File.separator will take care of platform … your files will always be saved under current working direcoty … you can provide shortcuts to access those paths and place them on desktop
If a user can execute the program that writes to that directory … I will assume that the user can also access the files without problem