File and Making Directories on Mac

I hope I put this question in the right place.
I recently found out it is possible make directories using from the File class (.mkdir()), and I've been trying to use it in my program on my Mac, but it doesn't want to make the folder. I don't know why its not making the folder. I've been compiling and running my program from version 1.4.2_07 on Tiger. Here is my code:
public static String makeDirForLib()
     File folder = new File("~/Documents/Lib/");
     folder.mkdir(); //this keeps returning false; I checked and the folder was not created
     return folder.getPath();
}I appreciate the help.

But "~/Documents/" does exist. Its the Documents folder in the current default Home directory. Does Java not recognize that "~", in Unix, is the same thing as typing out "/Users/<UsernameHere>/"?
I want the program to be able to create a separate folder in each Home directory depending on which login a user running it in. By using "~", I was trying to get Java to recognize that it should install in the default Home directory, meaning that if say my sister was running the program from her login, it would install in her Home directory, and if I ran the program from my login, it would install on my Home directory. Is there a solution to this, or an alternate method of achieving this?

Similar Messages

  • Hi ! i am using mac air i download from app store IDESKTOP when i open it its delete all my file and folder on my mac, hi ! i am using mac air i download from app store IDESKTOP when i open it its delete all my file and folder on my mac

    hi ! i am using mac air i download from app store IDESKTOP when i open it its delete all my file and folder on my mac, hi ! i am using mac air i download from app store IDESKTOP when i open it its delete all my file and folder on my mac

    Here you can contact the developer.
    (Notice, I'm posting this line only once. Not 4 times. )

  • How do i delete large files and pics of my mac book pro

    how do i delete large files and pics of my mac book pro

    Make sure that you do not delete any system file, or part of an application.
    Use Omnidisksweeper as a search tool   http://www.omnigroup.com/more

  • Downloaded yodot to recover hard drive files and now it says Mac OS X is full what do I do?

    Downloaded yodot to recover hard drive files and now it says Mac OS X is full what do I do?

    I have no idea what "yodot" is (let me Google it...). OK, looks as if it's a file recovery utility for Windows. Not sure why you'd need that...
    ...are you saying that you're getting a message that your disk is full? Please provide further information... see How to help us help you on these forums.
    Call back...
    Clinton

  • I am suddenly getting a message that the 'mobile device services' has stopped working on my computer and windows seems unable to fix.  I have tried finding the file and making sure that it is enabled.  It says 'enabled' but does not work.

    I recently downloaded a new update of the operating system on my 3GS  It seems to be a bit slower since and I have no idea if that is part of what is going wrong.  I cannot get itunes to recognise my phone.  Windows pops up a 'window' that says my 'mobile device services' is not working and would I like Windows to look online for the problem - I say yes, windows does it's thing, blanks out and I am back where I was.  I tried updating itunes but no luck.
    I found the mobiledeviceservices.exe file and made sure it was all 'on' and 'enabled' still no luck  I did a search and came up with some other people who had the same problem but the answers that they were given didn't help me.

    When you erased the disk did you select Mac OS Extended Journaled as the format option?

  • Can i migrate my files and programs from one mac book to another

    I have 2 macbook pros 13.3  april 2010 release
    one has a 250gb drive and the other 500gb
    both are running lion - after upgrading from snow leopard
    I have al my adobe creative suite and mac office on the machine with 250gb hard drive - i want to transfer all my files and applications including adobe and mac office to the 500gb machine - can this be done via migration assistant? are there things i need to check etc before doing this
    i am assuming the 250gb will be empty afterwards- i am not expecting to have 2 copies of the files and applications
    Thanks for taking a look at my question

    You can do that through Migration Assistant without any problem. See > http://support.apple.com/kb/HT4889
    There are different ways to connect both Macs in order to transfer the files. As both computers have got FireWire, I recommend you to buy a FireWire cable, connect it to both computers and run Migration Assistant. Doing this, the transfer will be faster and much reliable than with Ethernet or Wi-Fi. Also, check > http://pondini.org/OSX/MigrateLion.html

  • Aperture 3: Deleting raw files and making the jpeg my new master-

    Aperture 3 has made some great strides in making the following possible ( I posted this originally in 2007):
    What I'd like to do is shoot everything in raw + jpg, and then keep the raw files only for the important shots.
    I really like having the option of raw processing, but the storage demands are very heavy. If I could just make a selection of photos in a roll, and have a command to delete any unneeded raw files from the selected photos, while keeping the original jpgs as master, that would be great.
    Also, it would be great to be able to manipulate a raw file, and then when I'm satisfied with the image, to render a high-quality jpg from that raw file & make the jpg the new master, and then delete the raw file to free up disk space.
    Basically, I want the raw file safety net for everyday images, without gobbling up gigabytes of disk space <<<<<
    With Aperture 3, I can finally change the master to the jpg file, which solves part of the problem. But I still want to be able to manipulate my raw file, and render a new high-quality jpg master.
    Why don't Aperture / Lightroom do this? To me at least, it seems an obvious feature.

    I had a chance to talk to product managers from both Apple & Adobe about this at PhotoPlus Expo in NYC a couple years back. Both seemed receptive, but here we are - years later - no progress.
    I think part of the problem is that there's a purist mentality about RAW files. One should always shoot them - and then keep them forever- after all- they're your negatives!
    But what about event photography? Or weddings, as you pointed out? It makes no sense to burden your workflow & backup system with 4GB of RAW files of people grinning into the camera. Once the adjustments have been made, the RAW files are just a ball & chain on your data management. And let's not forget, once you really know what you're doing, your jpegs should be good most of the time anyway.
    I want RAW files as a safety net for errors in exposure and white balance. Once I know I have good photos, I don't need the safety net anymore- at least not at the price of all that hard disk space and transfer time for online backup. Of course, for my fine art stuff and important documentary work, I'll always keep the RAWs permanently. But not for routine parties/events.
    You put your finger on the problem with re-importing jpegs as a solution. You lose your metadata- rankings/album memberships, etc. This is no solution!
    What I want is simple, and it would be immediately useful to countless photographers:
    1) Let me batch-delete RAW files when the jpegs are ok.
    2) Let me do adjustments on my RAW file, render out a high-quality jpeg, and make the jpeg my new master.
    Whoever does this first - Aperture or Lightroom - that's the product I'll use.

  • Canon HG10 :Merging mov files and output on a Mac

    Hi,
    I'm on MacOSX 10.5.8 and currently working on a little video project.
    I must admit my ignorance on the subject is comparable to my grandma asking how to send an email. So please be nice
    I have several .mov videos imported from my Canon HG10 at the highest resolution (which according to Quicktime Movie Inspector is 1888x1062 - FPS 29.97).
    Now I need to a) merge all of them into one file and b) convert the output onto a much lighter but still good quality format (H.264 mp4?).
    I spent a good few hours on iMovie but since I don't need to edit the video it looked like I was pretty much wasting my time.
    Could anyone give me a quick 1-2-3 on how to do the above (hopefully there's some "lamers" solution out there)?
    Cheers!

    Here's Avids answer:
    Pro50 codecs only work in Macs, so the original files need to be EXPORTED from FCP with a special codec Avid created for Mac.
    So that's that issue solved ... hopefully, let's see after the next export.
    But .mov files are still screwed up on my PC.
    Kirk - I did reboot the machine in SafeMode, reinstalled QT, but nope - version 7.2. still doesn't play any .mov files properly that are stored on my C-drive that previously were just fine.
    Thanks again.

  • HT3258 after   transferring data from old mac to new mac, I can't see the transfer files and application on new mac.?

    How can I see the      data and application that I transferred from Old Mac to New Mac?
    Transfer of all the files and application was successful but I can't see it on the New Mac.
    Help.

    Thanks for your reply
    I did reboot the system.
    still can't see new user.
    One thing though when the system finished transferring the files
    at the end a message came up
    " 2013-09-11 04:18:05 +0000 Paul Nirwan could not be created.
    I did the transfer two times, same thing. first time I used the WiFi
    and second time from my back up disk with USB connection, using Migration Assistant.
    Second time also said that Paul'Mac already exist, Paul'Mac 2 created.
    How can I get rid of first data trasnferred?
    It will be using too much space on hard drive if Ileave it therre.

  • Peak files and beach balls in MAC Premiere CS4

    Hello all,
    I having an issue, or should I say issues with Premiere CS4 on a networked Mac, and mac drive. Everytime I go to open a project premiere generates new peak files, which makes opening a 2 minute proj take like 20 minutes. And also it places a bunch of peak files in the folder which takes up space.
    Also, everytime I switch programs (like say go from Premiere to Safari, and back to Premiere) or the computer sits for a bit of time, I get the beach ball (of death) for like 5+ minutes before I can do anything with the project. This only happens on my computer, of which we have 4 networked and 1 is connected direct to the network drive which is a Lacie brand Quadra.
    PLEASE HELP!!!!!! Hahaha.
    Thanks,
    Greg

    Greg,
    As you know, the .PEK files are the Waveform Display. The .CFA files are the Conformed Audio. These are necessary for PrPro to edit, and to have the Waveform displayed.
    My guess would be that PrPro is loosing these, because of the networked environment. I'd try with the Assets copied to the local HDD, and make sure that all Scratch Disks are located locally, as well. If this works, once PrPro has gone through the process of .PEK and .CFA writing, so long as these files are not moved, that should be it, and PrPro should be able to find these files and use them, without additional Conforming and PEK generation.
    I've had similar occur on mapped network drives, and just doing the copy and redirecting PrPro to those copies (Relink Media) has cured it. I now only use network drives as storage for Assets, and not to provide same to PrPro for editing.
    Good luck,
    Hunt

  • How can I transfer my iTunes Media Library from one PC to another without losing files and making a mess of the file and album structure?

    I have imported a number of Café del Mar CD's to iTunes, and iTunes keeps scattering the tunes into several different folders in iTunes Media. It also has trouble finding album information, unless it has been downloaded from iTunes Store. Previous versions of iTunes I have tried didn't have this problem.
    I've tried to tidy the files manually in iTunes Media, but that usually results in duplicates, so I stopped messing with it. I actually wouldn't mind iTunes blowing up my albums into a nightmare file structure of hyper categorization in iTunes Media (Album, Album Artist, Artist, etc.) if only it recognised its own mess when I transfer the library from one iTunes library into another.
    An example: I downloaded Cafe del Mar - Essential Elements featuring 13 tunes, two of these can be found in the files Cafe del Mar/Cafe del Mar Essential Elements, iTunes also created the folder Cafe del Mar/Cafe del_Mar Essential Elements containing 0 tunes!?! and the rest of the tunes are found under Rue de Soleil in the root folder, indicating ONE of the artists as the criteria for creating a folder of tunes!?!
    I am trying with every fiber NOT to hate this program, and would appreciate it if someone could explain to me how I can move an iTunes Media library of aprox 54 gb from my desktop via an external harddisk onto my laptop. I have tried 4 times, and everytime the result varies. Sometime I transfer 3000 files, other times 4000. Which files follow and don't is random. I lose files tranferring to the external harddisk and lose even more files from the external disk to the new library on my Lap. Do I have to transfer song for song or can this genius program actually transfer a larger amount of files without losing half the files and duplicating the rest?
    Is there a limit of size or amount of files?

    Backup with this User Tip, restore the library to the new computer using the same tool, keep the backup up-to-date in future. Deauthorize the old computer if you no longer need to access protected content on it.
    As to your issues with compilations albums select all the tracks, set the Album Artist to Various Artists and on the options tab set Part of a compilation to Yes. See Grouping tracks into albums for details.
    tt2

  • Why do complete web pages download as a file and a folder on macs as opposed to the single file downloads in safari?

    Is it necessary to have both a folder full of files and a individual file appear whenever I want to download a complete web page in firefox. This is not the case in safari. It is inconvenient to have to keep two icons for every web page, and if I put the file icon into the folder of other files that download with each web page it is not a simple click of an icon to open the page offline. I have to go into the folder and find the file icon. Am I missing some setting to make this work as easily in firefox as it does in safari? Thanks.

    Safari use webarchive format. http://en.wikipedia.org/wiki/Webarchive
    Firefox doesn't include a similar feature, but a feature like that can be added via either the MAF extension or the UnMHT extension. <br />
    https://addons.mozilla.org/en-US/firefox/addon/mozilla-archive-format/?src=search <br />
    https://addons.mozilla.org/en-US/firefox/addon/unmht/?src=search

  • Delete files and sub-directories over created over 1 year ago

    Hi Josh,
    Have a look at this script I got for cleaning up a scans folder.
    It's a bit over the top but it works.

    Hello,
    I have a batch script that runs at the start of every month which clears report files and moves them into an archive directory in a folder with the date of the move. So the archive folder doesn't fill up i want to run a script on it that clears out any folders created over 1 year ago.
    I've got:
    Set dir="C:\aa_Mine\test\testto"
    Echo Deleting all files from %dir%
    del %dir%\* /F /Q
    Echo Deleting all folders from %dir%
    for /d %%p in (%dir%\*) Do rd /Q /S %%p
    pause
    which deletes all the files and folders in the directory but is there a way only doing it for ones edited over 1 year ago. I tried to add the /minage: command but its not supported.
    Any ideas?
    Cheers
    This topic first appeared in the Spiceworks Community

  • Inserting a PDF file and making it a hyper link

    I created a news letter in pages and converted it to a PDF file, I want to place the PDF file onto my website and make it a hyperlink so when it is clicked on it will open preveiw or adobe acrobat reader (on reg pc) When I drag the PDF file it opens an post the full page. Can it be done and how?
    Thanks
    imac   Mac OS X (10.4.8)  

    The iWeb way is to use "Link to File".
    Your PDF will upload and viewers can click a link to download it.
    You can also use an image as a placeholder for your Link to File download instead of using a text description.

  • Where are the files and logs store in Mac while surfing internet?

    Hi everyone,
    I just switch over to Mac from windows recently. I was wondering where are all the temp. internet log and files store in Macbook Pro while surfing the internet. In windows its in temporary internet folder but how about Mac.
    I do know we can clear the cache when in Safari. However does it really clear all the downloaded contents from internet?
    All advise are welcome!
    Thank you!!

    Not sure what you are looking for.  The directory your download files into is specified in the safari preferences.  Safari records some of its stuff (preferences, bookmarks, history, etc.) in ~/Library/Safari.  Finally the caches are in ~/Library/Caches.

Maybe you are looking for

  • How to dynamically include textelement in smartforms

    Hi Experts, I need to print payslip using smartform and need to take the values from pay99_result. I took all the values and filled in the internal table and passed to smart forms, but the requirement is when ever particular wage type is given for an

  • Text Data Value of the Customer Master

    Dear All, I have created a new text types for the customer as Z001 and Z004. But now i want to create report with the customer and value maintain in those text fields. I'm little confuse how take the values. I know i have to go to the table STXH but

  • No Adobe Printer installed with Acrobat XI Pro

    I have recently replaced Acrobat 8 Pro by XI Pro on a machine running Win XP Pro SP3. After installation, the Adobe printer was missing in the printer menu, and attempts failed to use the "Make pdf" button from within MS Office applications. When pro

  • Total no of records in a recordset?

    I creating an application in which I send a query to database. Then loop through the ResultSet object and increment a counter to find the total no. of records in it, and then a generate JLabel array equal to the size of counter which is application's

  • NVision report through Report Book generating special characters

    Problem generating nVision Tabular report using Report Book. Reports brings special characters on two tabs after half way down the report. When we run the same report through two-tier mode it comes out clean. Tested the production and test layouts, t