Has anyone encountered any issue with getName() function of File class in UNIX environment ? In windows platform getName() returns the name of the file ("filename.txt"), but the same is returning me the entire path in unix ("c:\folder\filename.txt").
Please let me know if there is any direct approach to resolve this issue ? I'm planning to find the last index of / and truncate the string
Thanks ! Rajeev
author and iconoclast
"c:\folder\filename.txt" doesn't look like a path on UNIX; it looks like an (odd, but legal) filename, since "\" is not a directory separator on UNIX: "/" is. The File class knows how to work with paths and files on the local system, so on a UNIX system, it's not going to know what to do with your Windows paths.