how to add directory name after uri I want to append the name of a directory, say 'abc' to public:// uri of sites/default/files directory, such that it will point to the 'abc' directory inside sites/default/files.

Actually, whenever I try to do this file_move($file_object, 'public://abc', FILE_EXISTS_REPLACE) it moves the file inside sites/default/files and creates a file called 'abc'.

I want to move the file inside 'abc' directory, by appending 'abc' to public://, how do I do this?

I have searched for this and found that public://abc does the trick, but its not working for me.
Your function is telling drupal to move $file->filename to public://abc and hence renamed to abc. Drupal is doing what you are asking to do.

your $destination should be - 'public://abc/' . $file->filename 

file_move($file, $destination, FILE_EXIST_REPLACE ); 

Below code should work (though not tested):

 $file = file_load($fid);
 $destination = 'public://abc/';
 if(file_prepare_directory($destination, FILE_CREATE_DIRECTORY)) {
   file_move($file, $destination . $file-&gt;filename, FILE_EXIST_REPLACE);
 }