There are many things that can go wrong: A class works in Unix but doesn't on Windows (or vice versa) Invalid filenames due to double or missing path separators UNC filenames (on Windows) don't work with my home-grown filename utility function UNC (U…
public class File extends Object implements Serializable, Comparable<File> 构造方法: public File(String pathname) 按照完整路径实例化 public File(File parent, String child) 按照父路径和文件名实例化 成员: public static final String separator 目录分隔符 ('\'.'/'等) public static final…
java.io.NotSerializableException: test.io.file.Student at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1183) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) at test.io.file.Demo4.test2(Demo4.java:36)…
#!c:\\perl\\bin\\perl.exe use IO::File; #读取一行 my $fd = IO::File->new('perl.txt'); my $one_line = <$fd>; print $one_line; $fd->close; #写入数据 my $wfd = IO::File->new(">> readme.txt"); print $wfd "I love Perl!\n"; prin…