Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Case-sensitive of filename

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I wish to download a text file from a remote server.
As Unix is case-sensitive, is it possible to download a file
regardless of the case-sensitivity of its filename?
That means if the server store this file named "ABC.TXT",
so even if I input "abc.txt", I can still download the file.

Thanks to advise if you have some solution.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It depends. You don't tell us HOW you are downloading the file (Tell The Details). For example, if you were using HTTP to contact a Tomcat web server, there's a switch in the context configuration that lets you turn off case sensitivity.
 
harry flower
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I use ServerSocket to connect to the remote server.
My program is not a web application so I am not using tomcat.
It just FTP the file to local machine. Is there a way to search
for the file by ignoring the filename case-sensitivity?
Thanks.

Below are part of my codes:

/* @param dataSocket: The serverSocket created at local machine.
* @param pfilename: Remote file name
* @param pdestPath: Remote directory name
*/
private void getRemoteFile(ServerSocket dataSocket, String pfilename,
String pdestPath) throws IOException, FTPException
{
try
{
initializeGet(pfilename);
BufferedOutputStream out = new BufferedOutputStream(
new FileOutputStream(
pdestPath + File.separator + pfilename, false));
DataInputStream in = new DataInputStream(dataSocket.accept()
.getInputStream());
byte[] buffer = new byte[chunkSize];
int len = 0;
while ((len = in.read(buffer, 0, chunkSize)) > 0)
{
out.write(buffer, 0, len);
}
out.flush();
out.close();
in.close();
dataSocket.close();
}
}
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not aware of any way to do case-insensitive FTP. You may want to check the documentation of your particular FTP server to see if there is an option.
 
The overall mission is to change the world. When you've done that, then you can read this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic