Programming :: Copying A Directory In Ant Buildfile?
Sep 13, 2010
I'm having trouble copying a directory from one place to another in my build.xml file. I need to copy an image directory from the base directory (or root directory) to the dist directory so that it can be included in the jar file when I'm done compiling my java files.
This is my base directory:
drwx------ 1 enrique enrique 4096 2010-09-13 21:19 build/
-rwxrwxrwx 1 enrique enrique 1861 2010-09-13 22:17 build.xml*
drwx------ 1 enrique enrique 264 2010-09-13 21:19 dist/
drwx------ 1 enrique enrique 8192 2010-09-11 19:30 img/
drwx------ 1 enrique enrique 4096 2010-09-13 21:18 src/
The build/ and dist/ directories are created when I compile my java files from the src/ directory and img/ is where i have all my .png files which are needed for the program to display correctly.
Now for my Ant file: build.xml:
<?xml version="1.0"?>
<project name="PokerFiles4" default="compile" basedir=".">
<!-- Setting properties -->
<property name="dir.src" value="src"/>
[code]....
how I can get my img/ directory in the jar file would be appreciated, I'm writing a poker application to generate statistics for poker hands post-flop, and on the turn, like pot odds, hand odds, poker odds, outs, etc, I got the gui working, all I have to do is get the buttons in the app working, but all my classes are written and are working fine.
View 3 Replies
ADVERTISEMENT
Apr 4, 2010
I m having a RHEL-5 sever.ABC directory size is 57GB after taking backup in the same disk with name ABC.bkp showing 56GB. i used below command to copy/backup. # cp -r ABC ABC.bkp (different sizes after copying)..I checked both the directory sizes by #du -sh <ABC> and du -ks <ABC.bkp>In both GB and KB there is lots of difference (200mb). why this will happen in copying? what is the solution for above question? what is the correct way of copying 1dir to newdir exactly?
View 4 Replies
View Related
Jun 30, 2011
How would i go about copying files to a directory, yet skip the files that already exist in the directory, and also remove the files that are in the directory. For example:
Code:
$ls /dir1
img001.jpg
img002.jpg
[code]....
Now i would like to copy from dir1 to dir2, but the contents of dir2 would be:
Code:
$ls /dir2
img003.jpg
View 7 Replies
View Related
Jan 17, 2011
While doing some tidying up, in the process of moving some directories off my temporary mint kde desktop, I lost the contents of an important data directory on my data partition. Just to try to explain a bit of background, I have been using mint kde4 as a stopgap measure until I got squeeze working again ( i have been having graphics problems) and had a symlink on the desktop to a /data directory on my data partition. As I just got squeeze working again, I was moving stuff that had accumulated on the mint desktop to a directory named /2010 in the /data directory on the data partition, but accidently copied/pasted the /data symlink along with the 3 other directories I had highlighted. So effectively, I was accidentally copying the /data symlink to /data/2010. For reasons I don't understand, the whole of the contents of the /data directory disappeared, and it is now totally empty. I thought, that cannot happen can it? So I opened gparted and sure enough, that partition, which previously had about 70 gb of data in the /data directory was empty apart from /lost+found and an odd text file I had stored there. The /data directory is still there, but empty. I shut down Mint and booted into squeeze, thinking it must be a mistake, but gparted shows it has all gone. How on earth can this happen? I have some of the data backed up but a fair bit of the recent stuff isn't, so I need to recover it. I hoped the file system check that happened when I booted back into squeeze would maybe repair anything that got broke, but it showed as clean during boot.
View 5 Replies
View Related
Feb 10, 2010
I've a directory containing around 2.8 lacs of files. I want to move them to another directory.If I use cp or mv then I get an error 'argument list too long'. If I write a script like
for file in ls *; do
cp {source} to {destination}
done
then because of ls command , its performance degrades.How can I do this?
View 7 Replies
View Related
Apr 15, 2010
I am getting ready to upgrade from Ubuntu 8.10 to 9,04 (I am a bit behind, I know). I just drag my home folder to a USB drive to back up and it should copy all the files (including hidden ones).
When I tried this, I get the error that Symbolic links cannot be created. Should I worry about this? Would this effect my backup in some fashion?
View 8 Replies
View Related
Dec 21, 2010
im thinking of copying my /home directory by just click & dragging it to my external usb hard drive. then do a fresh reinstall. then just replace the new /home directory with the one on my hard drive(old home directory) will it have my original programs i used to have and all my settings & stuff?
View 10 Replies
View Related
Jul 22, 2010
What I'm trying to do: write a script that will list all the directories in a given location. Ask the user to enter a number corresponding to the location of the directory in the list, and then moving into that directory.
I have written a script to do this, but it only works when I run it as: <user>$program_name and the script runs in a sub-shell. But, when it is run in a sub-shell, the changes made by the script go away after the script ends.
When I run it as:
<user>$. program_name
and the script runs in the current source shell, I get an error:
bash: cd: /home/dev/Project/dirname: No such file of directory
Code:
IFS='
' read -d '' -a ArrName < <(ls ~/Projects)
read filenumber
cd $HOME/Projects/${ArrName[$filenumber]}
View 6 Replies
View Related
Mar 13, 2011
I'm trying to resume copying from a mounted CIFS device to my local hdd with cURL. I tried
Code:
$ curl -C - -O file://myfile
and also
Code:
$ curl -C <manual offset> -O file://myfile
(looked up the manual offset using "$ wc -c")
This resumes copying if I cancel it eg with ^C.
But it does not work if I unmount and remount the CIFS device. cURL then ignores my given offset and continues again from start as if nothing were there without saying a word. With "-C -" the same effect.
View 2 Replies
View Related
Aug 9, 2010
So I have a bunch of directories:
dir1
dir2
dir3
etc.
which themselves all contain subdirectories:
dir1subdir1subdir2etc.and at the lowest level they contain all of these jpegs that I need. The problem is that I only need some of them. They're named like this:
pic1.jpg
pic1_med.jpg
pic1_small.jpg
pic2.jpg
pic2_med.jpg
etc.
I want to just grab the ones without the size suffix and copy them all to another set of folders, while preserving the directory structure. The numbering all starts at 1 for each low level subdirectory, so I think that the directory structure is the only way to not get them mixed up.
I know that cp has a recursive option -r but how do I just extract the ones without the underscore? And then how do I preserve the directory structure when I move them over?
View 1 Replies
View Related
Mar 12, 2011
How do I copy and/or move files to the base folder of a user? I don't know what is is called, so I do not know what to put in the my file "?" command? I know you would normally put mv filename /directoryname, but what is the base username called?
View 1 Replies
View Related
Jun 26, 2010
Create a copy of the file above and call it commands.sorted. Use the vi command to manually sort this file. I.e. use yy to copy a line, P or p to paste a line, and dd delete a line. Order the commands with the two lines starting with double quotes first. Then list the rest of the command in alphabetical order.
Anyone have any ideas what he's talking about? Can I copy a file and rename it at the same time while copying it to the same exact directory again? Now sure what the two lines things means either. I have an email out to him but it usually takes a long time for him to answer me. I got alot of work to do so everytime I get hung up it kills me.
View 2 Replies
View Related
Oct 17, 2010
I am a dummy in C programming. I have a problem with copying the array of 64 elements of unsigned char to array of 8 element of uint64_t. For example:
unsigned char p[64]
uint64_t Data[8];
memcpy (&Data, &p, 64);
I am not sure if it is right. Please help me. Thanks a lot.Moreover, do both p and Data have 64 bytes?
View 2 Replies
View Related
Jun 27, 2011
I had a question about threads and mutexes recently answered and a members' answer sparked a different problem.'Nominal Animal' in the post mentioned said I should hold a mutex only long enough to copy my data to a temporary variable and then output by reading that temp. Here's some code on this. I must be copying the array of structs wrong because when the gui thread reads the temp copy, I end up with lots of garbage. Even running through gdb verifies that different data is in the temp array-copy than in the original.How do I go about copying this array of structs to another variable correctly in the gui thread?
Code:
typedef struct
{
[code]....
View 7 Replies
View Related
May 18, 2009
I am working with DM355 target board. Here we record. The video coming from IP cameras. Now I have to write c program for copying. The recorded avi files with date and time to NAS server using scp. I wrote a script to copy single file to NAS server.
#!/bin/bash
DATE=$(date +%Y%m%d_%H_%M_%S)
mv Camera1.avi Camera1_$DATE.avi
scp Camera1_$DATE.avi root@192.168.1.4:/root/test/
mv Camera1_$DATE.avi Camera1.av
But I have to write c program for copying multiple avi files with Date and Time to NAS server.
View 5 Replies
View Related
Nov 10, 2010
Code:
function forcd
{
[code]...
View 2 Replies
View Related
Jul 14, 2010
I'm running Linux version 2.6.33.4 on an ARM9 and can successfully copy directly into the framebuffer using the command:
Code:
cat /usr/myfile.bin >/dev/fb0
I converted myfile.bin from a 640 x 480 x 24 bmp.
What I'd like to do is to have the ability to dump .bin image files directly into the framebuffer from a C program without shelling out to a cat command.
View 3 Replies
View Related
Dec 23, 2010
I am working on an application in Motif and C++, which uses an XRT Table. With the XRT Table being an infrequently used product, it is hard to find good documentation on it, and one area in particular is sorely lacking... a good explanation on how to copy text from the table to the clipboard used by other X11 applications. I've come across an example application that demonstrates how to copy text to the clipboard, but I cannot seem to merge that knowledge with what I'm provided with the XRT Table API. Does anyone have any knowledge in using the XRT Table, and in particular, with copying selected fields within the table to the clipboard?
View 3 Replies
View Related
Jul 2, 2010
Is there a way to recreate all the folders from one directory to another without copying over the contents of the folder? I've been trying to do something like this,
Code:for i in `ls $X`; do mkdir $PATH/$i; doneUnfortunately $i is deliminated by whitespaces in the filenames and not the actual folders.
$X contains only other folders so I dont have to worry about regular files but any kind of more "advanced" solution would work.
View 1 Replies
View Related
Jan 3, 2009
After i try to find logfiles follow date/month/year. i want copy this files to another directory with name's directory is time you find(date/month/year).
View 4 Replies
View Related
Jul 26, 2013
How do you set up a command just to copy a file's full path name (%F) onto the clipboard?(I can't seem to get this without copying the contents of the file.)
View 2 Replies
View Related
May 4, 2010
Seeking a decent Perl or Bash script or hack used to copy data from a CD/DVD to local or even remote hard drive/storage.
View 7 Replies
View Related
Jul 1, 2010
I installed OpenCV and am trying the example programs. When I try to compile like in the tutorial it is not finding highgui.h.I have 64 bit Mint if that helps at all
View 3 Replies
View Related
Nov 14, 2010
There are millions of files in many directories. Wherenver i try rm * or find or use xargs, they say 'argument list too long' and exit. How can i deleted files in a directory with so many files without deleting the directory itself.
View 3 Replies
View Related
Dec 27, 2010
How to get the contents of a directory in C++?I know about opendir(), but I wonder if there is a C++ way (that uses classes and exceptions).
View 1 Replies
View Related
Dec 14, 2010
I have a database of around 4000 files. I use rsync script to transfer from 2 separate updated hdd every month but I need a way to compare a .txt file or .xml file to the updated drive as I cannot use rsync delete because I can not mount all 3 drives at the same time?
View 9 Replies
View Related
Apr 4, 2011
I need to walk in folder recursively in C. To change the directory, I can use chdir, but how I can get the directories of a directory?
View 3 Replies
View Related
Sep 18, 2015
I’m new to C programming so I wrote the following program to see if everything I needed to write programs with GCC and the standard C library was already installed. I am having issues in OS 10.10.5, where I am unable to build and compile some simple code, either using Xcode or Sublime text. I decided to install Linux Mint in Virtual Box to see if it would work.
Code: Select all#include <stdio.h>
void main()
{
printf("Hello! This is my first C program with Linux Mint
");
}
For some reason, I'm getting the following error:
mint@mint-VirtualBox ~/Desktop $ gcc hello.c -o hello1
hello.c:2:19: fatal error: stdio.h: No such file or directory
#include <stdio.h>
[code]...
View 8 Replies
View Related
Feb 13, 2011
gcc kk.c : kk.c:1: fatal error: gtk/gtk.h: No such file or directory compilation terminated.
View 1 Replies
View Related
Mar 22, 2011
I know this does'nt work but how in my script would I get the script to confirm it's directory is in.
if [ $pwd -eq $LOG_DIR ];
then
echo "work"
[code]...
View 4 Replies
View Related