ʹÓà Java ¶Ô Linux ÏÂÎļþ±àÂë¸ñʽ½øÐÐÅúÁ¿×ª»»
ʹÓà Java ¶Ô Linux ÏÂÎļþ±àÂë¸ñʽ½øÐÐÅúÁ¿×ª»»
²âÊÔʹÓÃ˵Ã÷£º
1¡£½« ×Ö·û¼¯±àÂë¸ñʽΪ GB2312 µÄÎļþ test0.java£¬test1.java£¬test2.java ·ÅÔÚ /home/defonds/tmp/test Ŀ¼Ï£¨test0.java£¬test1.java£¬test2.java ×÷Õß¿ÉÒÔ×ÔÐÐËæÒâ´´½¨¡£ÈçºÎ²é¿´ test0.java µÄ×Ö·û¼¯±àÂë¸ñʽ£¿´ò¿ª test0.java £¬Îļþ -> Áí´æΪ£¬µ¯³öµÄ¶Ô»°¿òÀïµÄ“×Ö·û¼¯±àÂ딼´µ±Ç°ÎļþµÄ×Ö·û¼¯±àÂë¸ñʽ¡££©¡£
2¡£Ð½¨Ò»Ä¿Â¼ /home/defonds/tmp/test2£¨Ò²¿ÉÒÔ²»½¨£¬³ÌÐò¿ÉÒÔ×Ô¶¯Éú³É£©¡£ÔËÐÐ EncodeConverter.java¡£
3¡£´ò¿ª /home/defonds/tmp/test2 Îļþ¼Ð£¬·¢ÏÖÓÐÐÂÎļþ test0.java£¬test1.java£¬test2.java Éú³É£¬²é¿´Æä±àÂë¸ñʽ£¬ÊÇΪ UTF-8£¬Ö¤Ã÷תÂë³É¹¦¡£
4¡£Ê¹Óñ¾¹¤¾ß¿ÉÒÔ¶Ô Linux ÏÂÎļþµÄ×Ö·û¼¯±àÂë¸ñʽ½øÐÐÅúÁ¿×ª»»¡£Ö»ÐèÊʵ±ÅäÖÃһϣ¬¿ÉÒÔÅúÁ¿´¦Àí¸÷ÖÖÎļþ¸ñʽµÄÎļþ£¬Èç *.txt£¬*.java µÈµÈ¡£
ʹÓà Java ¶Ô Linux ÏÂÎļþ±àÂë¸ñʽ½øÐÐÅúÁ¿×ª»»Ô´´úÂëÈçÏ£º
package demo;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileFilter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
/**
* ÏîÄ¿Ãû³Æ£ºTest64.0-ec
* ÀàÃû³Æ£ºEncodeConverter
* ÀàÃèÊö£ºLinux ÏÂÅúÁ¿×ª»»Îļþ±àÂë¸ñʽ
* ´´½¨ÈË£ºDefonds
* ´´½¨Ê±¼ä£º2009-12-2 ÏÂÎç03:37:15
* ÐÞ¸ÄÈË£ºDefonds
* ÐÞ¸Äʱ¼ä£º2009-12-2 ÏÂÎç03:37:15
*/
public class EncodeConverter
{
// ÔÎļþĿ¼
private static String srcDir = "//home//defonds//tmp//test//";
// ת»»ºóµÄ´æ·ÅĿ¼
private static String desDir = "//home//defonds//tmp//test2//";
// Ô´Îļþ±àÂë
private static String srcEncode = "gb2312";
// Êä³öÎļþ±àÂë
private static String desEnc
Ïà¹ØÎĵµ£º
Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖÐÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀÐÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......
Ò»£ºÇ°ÑÔ
×î½üÔÚÑо¿androidµÄsensor driver£¬Ö÷ÒªÊÇE-compass£¬ÆäÖÐÓõ½ÁËLinux input×Óϵͳ.ÔÚÍøÉÏÒ²¿´Á˺ܶàÕâ·½ÃæµÄ×ÊÁÏ£¬¸Ð¾õ»¹ÊÇÕâƪ·ÖÎöµÄ±È½ÏϸÖÂ͸³¹£¬Òò´ËתÔØÒ»ÏÂÒÔ±ã×Ô¼ºÑ§Ï°£¬Í¬Ê±ºÍ´ó¼Ò·ÖÏí£¡
£¨Õâƪ²©¿ÍÖ÷ÒªÊÇÒÔ¼üÅÌÇý¶¯ÎªÀýµÄ£¬²»¹ý½²½âµÄÊÇLinux Input Subsystem£¬¿ÉÒÔ×ÐϸµÄÑо¿Ò»Ï£¡£©
¼üÅÌÇý¶¯½«¼ì ......
1. ѧ»áд¼òµ¥µÄmakefile
2. ±àһЩӦÓÃ
³ÌÐò
£¬¿ÉÒÔÓÃmakefileÅÜÆðÀ´
3. ѧ»áдÇý¶¯
µÄmakefile
4. дһ¼òµ¥charÇý¶¯£¬makefile±àÒëͨ¹ý£¬¿ÉÒÔinsmod£¬ lsmod£¬ rmmod. ÔÚÇý¶¯µÄinitº¯ÊýÀï´òÓ¡hello world£¬insmodºóÓ¦¸ÃÄܹ»Í¨¹ýdmesg¿´µ½Êä³ö
¡£
5. дһÍêÕûÇý¶¯£¬ ¼ÓÉÏread£¬ write£¬ ioctl£¬ pollingµÈ¸ ......
ʹÓÃlinux¶¯Ì¬Á´½Ó¿â£º
ÔÚUnixÉÏ´æÔÚÁ½Öֿ⣺¶¯Ì¬¿â£¨.so£©ºÍ¾²Ì¬¿â£¨.a£©£¬²ÉÓö¯Ì¬¿â£¨¹²Ïí¶ÔÏ󣩼¼Êõ¿ÉÒÔ·½±ã³ÌÐò¼ä¹²Ïí£¬½ÚÊ¡³ÌÐòÕ¼Óпռ䣬Ôö¼Ó³ÌÐòµÄ¿ÉÀ©Õ¹ÐÔºÍÁé»îÐÔ¡£
²Ù×÷¶¯Ì¬¿âµÄº¯ÊýÔÚdlfcn.hÎļþÖж¨Ò壬ËùÒÔÒªÔÚʹÓö¯Ì¬¿âʱinclude <dlfcn.h>
&n ......