Go to Post With three robots, I was expecting better scores but I guess more robots means more penalties, not more points. - sanddrag [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 24-02-2014, 21:40
Secretspy97 Secretspy97 is offline
Registered User
FRC #1126
Team Role: Programmer
 
Join Date: Oct 2011
Rookie Year: 2009
Location: New York
Posts: 25
Secretspy97 is an unknown quantity at this point
Creating a folder on the cRIO

I am trying to create a folder on the cRIO and then save images from the camera in it.
This is what I have so far:
Code:
private FileConnection photoConfig;
    private final String photoPath = "file://Data/";

try { 
            photoConfig = (FileConnection)Connector.open(photoPath);
            photoConfig.delete();
        } catch (IOException ex) {
            ex.printStackTrace();
        }
        
        try {
            photoConfig.create();
        } catch (IOException ex) {
            ex.printStackTrace();
        }
Whenever I run this I get a error saying "directory can not be created".

Can someone please tell me what I am doing wrong.
Thanks!!
__________________
WHAT TIME IS IT?
1126
Reply With Quote
  #2   Spotlight this post!  
Unread 24-02-2014, 22:08
DavisC DavisC is offline
Registered User
FRC #0539 (Titans)
Team Role: College Student
 
Join Date: Jul 2011
Rookie Year: 2010
Location: Virginia
Posts: 200
DavisC is just really niceDavisC is just really niceDavisC is just really niceDavisC is just really nice
Re: Creating a folder on the cRIO

Why not create a folder using Windows Explorer and have the program save images to the already created folder? (Unless you want to continuously do this through multiple runs each with a unique name, but that would probably quickly use up all of the memory in the cRIO.)
__________________
FRC Team 539
Student Member: 2010 Breakaway - 2014 Aerial Assist
Mentor: 2015 Recycle Rush - present
Reply With Quote
  #3   Spotlight this post!  
Unread 24-02-2014, 22:32
Secretspy97 Secretspy97 is offline
Registered User
FRC #1126
Team Role: Programmer
 
Join Date: Oct 2011
Rookie Year: 2009
Location: New York
Posts: 25
Secretspy97 is an unknown quantity at this point
Re: Creating a folder on the cRIO

The idea is that the folder can be deleted and then created again, clearing all the images. Less than 5 pictures will be stored in this folder per match. After each match the images will be downloaded.
__________________
WHAT TIME IS IT?
1126
Reply With Quote
  #4   Spotlight this post!  
Unread 26-02-2014, 19:10
Joey1939's Avatar
Joey1939 Joey1939 is offline
Registered User
AKA: Joey Holliday
FRC #1939 (Kuhnigits)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Kansas City, Missouri
Posts: 139
Joey1939 has a spectacular aura aboutJoey1939 has a spectacular aura aboutJoey1939 has a spectacular aura about
Re: Creating a folder on the cRIO

Maybe, instead of calling .delete() and .create() on the same object, try making a new instance of the FileConnection with the same file path to call .create() after you called .delete() on the first FileConnection. (Don't forget to close the first file connection before you make a new one; FileConnection.close()).

I don't know exactly how the delete() method works, but it may make the create() method then unusable.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 10:37.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi