Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Writing with printstream  RSS feed

 
sarathchandra chandala
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using PrintStream class(print()) whenever I want to execute a command on the ftp connected server through java. The print function is taking input as string and that string's characters are converted into bytes according to the platform's default character encoding.

With reference to the above whenever I want to execute a command , the first word of the command is printing in capital letters. for example

"find . -mtime -1" is changing to "FIND . -mtime -l" because of this the command is not recognized by the unix server.

I want to know how to change the character encoding of the printstream so that the command will print properly on the server.
Could anyone please guide me for the above.
 
Peter Lawrey
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like you are trying to send the 'find' to the FTP server and not to a shell.
If so, you can only execute the commands the FTP server supports, not the commands which might be installed on the server.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!