COMP SCI 200 Lecture Notes - Lecture 32: Working Directory, Mkdir

64 views4 pages

Document Summary

Comp sci 200- lecture 32- file input and output pt 2. Creates a file object, but not a logical file. All instance methods are based on this path. There are also methods to set the permissions. Other file properties long lastmodified()- date last modified long length()- number of bytes. String getparent()- returns the parent from the path. Boolean mkdir()- create directory based on path. Boolean mkdirs()- create all the directories in the path. String list()- list files contained in directory. This code is in an eclipse project called cs200examples import java. io. file; public class fileinfo { public static void main(string[] arg) { Another / placed at the end is optional. Only goes as far as the project. In java, there are many ways to read a file. Write a program that prints out every line from the filename pass in on the command line:

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents