How to prevent overring files

Hi All,
I wrote a programe to copy files in different folders to a specific destination folder. But the problem is if we have 2 files with same name it override the old file. Can any one help me to solve this.
Thanks in Advance.

Just now I came up with a solution. Every time when I am coping, end of each file i concat the name of the source folder. Then in destination every file is uniqe. Thanks for ur time.

Similar Messages

  • How to prevent excutable files run in the DOCUMENT_ROOT

    How to prevent excutable files run in the DOCUMENT_ROOT of the apache server?
    I just want it to run in /var/www/cgi-bin but not /var/www/html
    As far as I know, there is a module called SELinux in Fedora Core to protect the DOCUMENT_ROOT.

    I guess i just dont get it. chalk it up to a language barrier, or me not understanding...
    if you script is not executable (noexecute setting in apache, not in filesystem) then it shouldn't matter..
    if you do want at to be execute, but just want to control "where" it executes, you might consider running a chroot or something early in the script.
    and for gods sake..dont allow user input to ever determine a path or filename directly...
    /me shivvers

  • How to prevent a file from stripping?

    I'm building vacation for Arch64 but should be the same for 32bit. PKGBUILD looks like this:
    # $Id: PKGBUILD,v 1.1 2004/01/21 15:43:15 dale Exp $
    # Maintainer: dale <[email protected]>
    pkgname=vacation
    pkgver=1.2.6.1
    pkgrel=1
    pkgdesc="an automatic mail-answering program"
    depends=(gdbm)
    url="http://www.tosn.org/projects/vacation/"
    source=(http://www.tosn.org/projects/vacation/files/$pkgname-$pkgver.tar.gz vacation.patch)
    build() {
    cd $startdir/src/$pkgname
    mkdir -p $startdir/pkg/usr/{bin,man/man1}
    # keeps binary from building
    rm -rf vacation
    # fixing the Makefile - not only for arch64
    sed -i -e 's: -m486::; s:CFLAGS.*= (.*):CFLAGS += 1:' $startdir/src/$pkgname/Makefile
    sed -i -e "s:/usr/bin:$startdir/pkg/usr/bin:g" $startdir/src/$pkgname/Makefile
    mv vacation.man vacation.1
    make install
    These file have been created:
    [andyrtr@workstation64 vacation]$ ls -lRA pkg/
    pkg/:
    insgesamt 0
    drwxr-xr-x 4 andyrtr users 96 2006-01-28 09:32 usr
    pkg/usr:
    insgesamt 0
    drwxr-xr-x 2 andyrtr users 96 2006-01-28 09:32 bin
    drwxr-xr-x 3 andyrtr users 72 2006-01-28 09:32 man
    pkg/usr/bin:
    insgesamt 24
    -rwxr-xr-x 1 andyrtr users 16864 2006-01-28 09:32 vacation
    -rw------- 1 andyrtr users 470 2006-01-28 09:32 vaclook
    pkg/usr/man:
    insgesamt 0
    drwxr-xr-x 2 andyrtr users 48 2006-01-28 09:32 man1
    pkg/usr/man/man1:
    insgesamt 0
    [andyrtr@workstation64 vacation]$
    I get this error:
    ==> Starting build()...
    gcc -march=x86-64 -O2 -pipe  -Wall  -Xlinker -warn-common -D_PATH_VACATION="/var/abs/extra/system/vacation/pkg/usr/bin/vacation" -o vacation vacation.c -lgdbm
    install -s -m 755 vacation /var/abs/extra/system/vacation/pkg/usr/bin/vacation
    install -s -m 755 vaclook /var/abs/extra/system/vacation/pkg/usr/bin/vaclook
    strip: /var/abs/extra/system/vacation/pkg/usr/bin/vaclook: File format not recognized
    install: strip fehlgeschlagen
    make: *** [install] Fehler 1
    ==> ERROR: Build Failed.  Aborting...
    Krusader detects it as a Perl program. Any idea?
    AndyRTR

    Posted: Sat Jan 28, 2006 8:45 am    Post subject: How to prevent a file from stripping?
    I'm building vacation for Arch64 but should be the same for 32bit. PKGBUILD looks like this:
    Code:
    # $Id: PKGBUILD,v 1.1 2004/01/21 15:43:15 dale Exp $
    # Maintainer: dale <[email protected]>
    pkgname=vacation
    pkgver=1.2.6.1
    pkgrel=1
    pkgdesc="an automatic mail-answering program"
    depends=(gdbm)
    url="http://www.tosn.org/projects/vacation/"
    source=(http://www.tosn.org/projects/vacation/files/$pkgname-$pkgver.tar.gz vacation.patch)
    build() {
       cd $startdir/src/$pkgname
            mkdir -p $startdir/pkg/usr/{bin,man/man1}
            # keeps binary from building
            rm -rf vacation
       # fixing the Makefile - not only for arch64
       sed -i -e 's: -m486::; s:CFLAGS.*= (.*):CFLAGS += 1:' $startdir/src/$pkgname/Makefile
       sed -i -e "s:/usr/bin:$startdir/pkg/usr/bin:g" $startdir/src/$pkgname/Makefile
       mv vacation.man vacation.1
       make install
    These file have been created:
    Code:
    [andyrtr@workstation64 vacation]$ ls -lRA pkg/
    pkg/:
    insgesamt 0
    drwxr-xr-x  4 andyrtr users 96 2006-01-28 09:32 usr
    pkg/usr:
    insgesamt 0
    drwxr-xr-x  2 andyrtr users 96 2006-01-28 09:32 bin
    drwxr-xr-x  3 andyrtr users 72 2006-01-28 09:32 man
    pkg/usr/bin:
    insgesamt 24
    -rwxr-xr-x  1 andyrtr users 16864 2006-01-28 09:32 vacation
    -rw-------  1 andyrtr users   470 2006-01-28 09:32 vaclook
    pkg/usr/man:
    insgesamt 0
    drwxr-xr-x  2 andyrtr users 48 2006-01-28 09:32 man1
    pkg/usr/man/man1:
    insgesamt 0
    [andyrtr@workstation64 vacation]$
    I get this error:
    ==> Starting build()...
    gcc -march=x86-64 -O2 -pipe -Wall -Xlinker -warn-common -D_PATH_VACATION="/var/abs/extra/system/vacation/pkg/usr/bin/vacation" -o vacation vacation.c -lgdbm
    install -s -m 755 vacation /var/abs/extra/system/vacation/pkg/usr/bin/vacation
    install -s -m 755 vaclook /var/abs/extra/system/vacation/pkg/usr/bin/vaclook
    strip: /var/abs/extra/system/vacation/pkg/usr/bin/vaclook: File format not recognized
    install: strip fehlgeschlagen
    make: *** [install] Fehler 1
    ==> ERROR: Build Failed. Aborting...
    Looks like its tring to install to /var/abs/extra/system/vacation/pkg/usr/bin....... ????
    try make DESTDIR=$startdir/pkg/usr install

  • How to prevent .DS_Store files in specificied folders

    Hello.  I want to stop creation of .DS_Store files in Desktop and Picture/hoge folders only. Also I would like to keep its settings of .DS_Store files in other folders.  When I googled the web I found so many pages explaining how to prevent .DS_Store in network folders, how to stop creation of .DS_Store files in all of the OSX system and usage of TotalFinder. Those are not what I am finding for. I want to stop creation of .DS_Store files in only particular folders.  I can use AppleScript or Terminal commands.  Thank you very much.

    would creating an empty one, then locking it achieve what you need ?
    + locking existing ones as needed.
    briefly checking here causes no obvious problems, Finder still alows changes, but reverted after relaunch.

  • Acrobat 8: How to prevent "Combine Files" from adding a header?

    Hi All.
    I am using Acrobat 8 (Win XP SP II) and am having a problem with the "Combine Files" feature. In the past, I've used this function to create hundreds of PDF files from thousands of individiual PDF's. It worked great. But now, suddenly, Acrobat increases the landscape page height from 8.5 to 8.8 inches, and then adds a header containing document name and date info.
    I don't want this header. I've looked all over Acrobat and Distiller and converter preferences but can't seem to find how to shut this feature off. Can anyone help me?
    To see an example, go to:
    http://www.garywed.com/AcroProblem.jpg
    Many Thanks!
    Gary Wedemayer

    I have multiple single-page PDF files lying in a folder; I hit Files-->Combine Files, select the relevant PDF files, and let it rip using any of the quality settings (low, medium, high- makes no difference).
    But I see nothing in the Combine Files dialog box that is relevant to this kind of header, so it must be hidden somewhere else. Can't find it for the life of me, tho!
    If I have to I'll revert back to Acrobat 6.0 or write a Javascript to combine the files for me, but I know I can do it straight up in Acrobat 8 'cos I've done it many times before.
    Thanx.
    ---Gary Wedemayer

  • How to prevent swf files being downloaded

    People,
    I'm a teacher and I have some animations made in flash language (swf). I would like to publish these animations on my web site so my students could see, but I wonder if there is any way to prevent these animations being downloaded.
    Example: when I see an animation published on my web site, this animation is stored in Internet Temporary Files and I can save this animation anywhere. How can I prevent an animation is stored in the temporary folder? In other words, this animation can only be seen if the user is logged on the site.
    Urgent!!!
    Thanks.
    Alyson

    I think that's what I want. I found a site that has exactly what I need. It
    is done this way too?
    Plese take a look at http://www.edumedia-sciences.com/en/a559-scintigraphy
    <http://www.edumedia-sciences.com/>
    Thanks
    2009/11/16 moccamaximum <[email protected]>
    You could implement a kind of time-barrier, like in the trial versions you
    download from softwarecompanys.
    For the most users, that are not understanding actionscript and know how to
    read the code, even if they decompile it, that would prevent the swf being
    played after a certain date that you would have to implement in your code.
    In AS2 the code would be like this:
    >
    var now:Date = new Date(); //reads the user system date
    var release:Date = new Date(2009, 11, 16); //here goes the date, when you
    want to have the program deactivated
    >
    if(now <= release){
       playSwf(); // here goes your normal code
    >
    else{
       doNothing();
    >
    Like the most TimeBarriers this could be easily circumvented if the user
    sets back his system date, so do not give a message like "You trial period
    has expired"
    >

  • How to prevent copy files

    I make ntfs permission read only to users to view files only but i want to prevent them from take copy of these files outside this shared folder to their own pc 

    Hi,
    I'm afraid it is impossible. If User have permission to read, you cannot stop them from copying files. 
    Please remember to mark the replies as answers if they help and un-mark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • How do I share files between a PowerPC 8100 OS 7.6.1 and an iMac OS 10.7.4 over ethernet

    How do I share files between a PowerPC 8100 OS 7.6.1 and an iMac OS 10.7.4 over peer to peer ethernet connection? I'm trying to get data off the old machine so I can retire it for good. Can I just save the data and worry about file conversion later?

    Addendum
    There is a relatively simple server-based way of avoiding difficulties with incompatible system versions et cetera. It could possibly be of some interest.
    I tested the following between a System 7.5.3 PowerBook 540 and a Windows XP PC. It ought to work with a System 7.6.1 Power Macintosh 8100 and a MacOS X 10.7.4 iMac as well.
    a) Download and install Microsoft Personal Web Server 1.0 for Macintosh onto the 8100. If the 8100 does not have a direct Internet connection, carry out the download on another computer, and then try to transfer the hqx file (as it is) on a CD-R (burn at a low speed) or a 1.44 MB floppy (use StuffIt Expander to decode the hqx on the 8100). Do not change or add anything after the installation; just leave the files as they are.
    http://support.microsoft.com/kb/164571
    b) Drag a compressed example archive (we can call it example_file.sit) to the folder My Personal Web Site (there are other files inside this folder; do not worry about them). Ensure that the compression format is compatible with a decompression tool on the receiving computer.
    c) Many people have access to a router (wired or wireless) with a built-in Ethernet switch (usually something like four LAN ports). If applicable, disconnect any incoming Internet (the WAN port). If possible/necessary, switch off the wireless (see the router manual for details about this).
    d) Switch off both computers (and the router).
    e) Connect an AAUI to RJ-45 transceiver (such as the aforementioned Apple Ethernet Twisted-Pair Transceiver) to the AAUI port of the 8100.
    f) Connect an Ethernet cable from the transceiver to the first LAN port of the router.
    g) Connect an Ethernet cable from the second LAN port of the router to the iMac.
    h) Switch on the router.
    i) Start the computers.
    j) The TCP/IP control panel on the 8100 is set to connect via Ethernet. DHCP Server is used in this case.
    k) Open the Microsoft Personal Web Server control panel.
    l) Click on the Start button.
    m) Wait (can take a while).
    n) Notice the exact address at My URL (under Monitor Web Site). Could be something like http://192.168.1.2 (depends on the router).
    o) Launch a web browser on the iMac (I did the testing on the PC with Firefox and Safari).
    p) Enter the exact address (see n above) in the browser's address field (http://192.168.1.2 in my example). Press Return. A standard web page should appear. Disregard this page for now.
    q) Add the exact file name (example_file.sit) to the address shown in the field. The result would be http://192.168.1.2/example_file.sit in my case. Press Return.
    r) The file should start to download to the modern computer.
    All the above is intended for a local connection only (otherwise security settings become of importance), and should be considered purely experimental. There are further possibilities (including an FTP plug-in), but it also makes everything more complicated. I have not tested the behaviour with large files or with various files types. Sometimes the server may crash. If so, try a restart. Make sure that you have backup copies of important files already at the 8100 before you begin.
    Good luck!
    Jan

  • Just bought a new macbook w/ mtn lion. transferred data from my old macbook over n it created another user name. that's actually good--xcept for music, which i want on my new acct. How do i move files from my "old comp" acct to my new one?

    i just bought a new macbook w/ mtn lion. when i transferred data from my old macbook over, it created another user name (i called it "old computer"). That's actually good--I'm not going to be accessing old files frequently--except for music, which i want on my new user name. How do i move files from my "old comp" account to my new one? Is there a way to easily move large #'s of files, or just one by one? I've googled extensively but can only find instructions for OSX 10.6 and previous, which talks about the "Shared folder," which I can't seem to find.      

    jesster03 wrote:
    i just bought a new macbook w/ mtn lion. when i transferred data from my old macbook over, it created another user name (i called it "old computer"). That's actually good
    That's actually bad. Peruse Pondini's Setup New Mac guide and seriously consider starting over.

  • How I prevent the batting linestyle from being lost when opening an Autocad file in Illustrator?

    I have worked out how to open Autocad files in Illustrator, but Illustrator does not obviously recognise the batting linestyle I have used for insulation and it only appears as a straight line. Is there any where to preserve the batting line when opening the file in Illustrator?

    If a linestyle is not coming over, I would assign a unique color in CAD. This way you can select similar color in Illustrator, and change them easily in Illustrator.

  • How to edit xml file particular value. and how to send xml file over ip address 192.168.2.10 using ftp

    how to edit xml file particular value. and how to send xml file over ip address 192.168.2.10 device using ftp through Ethernet

    Hello
    For using FTP function in LabVIEW, I recommend you to check this document: FTP Basics
    Also, take a look at FTP Browser.vi, which is available at the Example Finder.
    To edit a XML file, try to use VIs in XML palette. Maybe Write to XML.vi helps you.
    Post your current VI if possible.
    Regards
    Mondoni

  • How to prevent the code viewing of jsp files

    hello friends
    How to prevent the code viewing on directly opening .jsp files at the server side
    Thanks in advance

    hello friends
    How to prevent the code viewing on directly opening
    .jsp files at the server side
    Thanks in advanceWhat exactly do you mean by code viewing? If by that you mean you don't want all the folders to show in the directory create a index.jsp file that has all the links to the pages you want to show
    If you mean something else please clarify

  • There is a black box on my screen that is announceing everything i do: ex if i go over file it will say file 22 items. how do i make it go away?

    how do i make it go away?
    ex: if i move my mouse over file, it will say file 22 items

    Hi,
    This sounds like a setting needs changing in the Finder's View menu. Choose View>Show View Options or hit Command-J. Uncheck Show Item Info in the resulting dialogue.
    Alastair.

  • Sequence file Version number. How to prevent the automatic resetting build version number whilst auto-incrementing revision number?

    Hi,
    I've got my environment set this way that each save of the sequence file increase the revision part of version number. However, during that increase the build counter is reset to 0. How to prevent it?
    TS 4.2

    Mimi,
    It is pretty common practice in software revisioning to reset a minor number to 0 when a major moves up 1.  There are many different schemes out there.  If you google or bing software versioning schemes you'll see what I'm talking about.
    So looking at it from left to right:  Major.Minor.Revision.Build = 0.0.0.1 
    if you change the Revision it would be expected that anything to the right (in this case Build) would reset to 0.  0.0.1.0!
    Let's say your version is 8.34.56.23.  It would make sense that if you were to change the Major number (which means a Major release) to 9 then your version would go to: 9.0.0.0. 
    A version number is just a unique way to tell someone which specific software you are using so it really doesn't matter that it resets to 0.  Although it makes sense because if you kept your build number sequential and didn't reset it then it would get outrageously larger which would be more annoying than anything. 
    Again this is common accepted practice in industry.
    Good Luck,
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • Our daughter figured out on her own how to delete songs and apps from her IPAD2. Her parents would like to know how to delete such files and then how to prevent our daughter from doing it.

    Our daughter figured out on her own how to delete songs and apps from her IPAD2. Drives us crazy since we continually have to reload these files. Her parents would like to know
    1. how she did it (delete files) and
    2. how to prevent her from deleting files in the future.

    http://support.apple.com/kb/ht4213

Maybe you are looking for

  • Document line item text in Clearing document

    Dear All, Document line item text My client want the vendor invoice line item text(BSIK-SGTXT) to be captured in the corresponding clearing document line item text field(BSAK-SGTXT). (i.e) The vendor invoice and its payment clearing document should h

  • Mail merge and print one document at a time?

    Hi all. I'm an Apple revert. I'm currently using the i7 iMac. Previous Apple computer was a //e. I print an 8 or 12 page newsletter for my work. I want my printer/copier to fold and staple each document individually. Pages seems to send all documents

  • Xorg.conf problems

    hi I have a working X-desktop with awesomeWM. problem is, my X only works without a xorg.conf, not with the Xorg -configure one or a minimalistic one. I have an intel 4500mhd graphic device, installed xf86-video-intel and evdev input devices. KMS, ha

  • Why Purchase Reqs created via BAPI_REQUISITION_CREATE are not shown in PR-

    Hello, I got few questions regarding the PReqs: 1. I'm creating PRs via JCo + BAPI_REQUISITION_CREATE and transactions are confirmed with the new PR numbers. But when I go to PR->Display I do not see them. I can only see them if I go to MM->Purchasin

  • Will you introduce me briefly to Arch and tell me if it's compatible?

    Hi! I am new to this place! Currently I am running Ubuntu, but unfortunately I am deeply disappointed with its bloated and opaque interface. In the Ubuntu forums I was recommended to give Arch a try. But before doing so, I have to be sure my hardware