Copy File Creation Error - Incorrect Function
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers incorrect function error or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x incorrect function initialize disk Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it how to fix incorrect function error only takes a minute: Sign up Why does Windows XCOPY fail when invoked via Perl system call via psexec? up vote 4 down vote favorite I'm using psexec to launch a Perl program on remote Windows machines. The program makes
Xcopy File Creation Error The System Cannot Find The File Specified
a system call to xcopy.This works fine when run directly (locally) on the machines, but when run remotely via psexec, the xcopy fails with the following message: File creation error - Incorrect function. (Depending on the user, the message may instead be "Access denied.") Note that $! gives the following diagnostic: Bad file descriptor at syscall.pl. perl exited on REMOTE with error code 9. It does not seem to make a difference whether xcopy is invoked via system() or backticks. incorrect function windows login I should point out that the "from" folder is a ClearCase dynamic view (M drive). Oddly enough, the xcopy seems to work correctly when called directly from psexec. Here are some other oddities: The xcopy doesn't always fail. Certain files just seem to be "cursed". The read-only attribute appears not to be a factor. Once a copy succeeds (e.g., via Windows Explorer), the curse is lifted, and that particular file will no longer cause xcopy errors. The problem does not seem to be with the destination folder. Once the curse is lifted, the file can be xcopy'd to a new destination. Following is a portion of the test Perl script I used to narrow down the problem (folder names have been genericized). Note that, for each "my $cmd" tested, I commented out the previous one, and added a status comment. # ClearCase directory M:\STUFF\ABC contains ABC.tst, ABC.zip and several nonempty subfolders # Directory copy, D drive to D drive #my $cmd = "xcopy D:\\temp\\src D:\\temp\\dest /e /i /y"; # works # Directory copy, M drive to D drive #my $cmd = "xcopy M:\\STUFF\\ABC D:\\temp\\dest /e /i /k /y"; # fails with "File creation error - Incorrect function" or "Access denied" # File copy (.tst), M drive to D drive (trailing backslash) #my $cmd = "xcopy M:\\STUFF\\ABC\\ABC.tst D:\\temp\\dest\\"; # works! # Directory copy, M drive to D drive (trailing backslash) #my $cmd = "xcopy M:\\STUFF\\ABC D:\\temp\\dest\\ /e /i /
when using xcopy and can't work out why? You are probably (like me) using a http://www.qdoscc.com/blog/xcopy-file-creation-error-parameter-incorrect USB disk or other drive which is formatted using FAT32 filesystem. If so, any file over 4GB in size will most likely throw up this issue. To resolve, re-format the drive as NTFS and the copy will then work. Search form Qdos Services Apple Networks AutoCAD Charity Specialists IT Support IT Training Search Engine Optimisation SharePoint incorrect function Consultancy VoIP Telephony Web Design Upcoming training courses AutoCAD / AutoCAD LT Basic Essentials 31/10/16 to 01/11/16 AutoCAD / AutoCAD LT Intermediate User 21/11/16 to 22/11/16 Basic Introduction to SharePoint 25/10/16 Developing InfoPath Forms 29/11/16 Discovering SharePoint 02/12/16 Excel Data Analysis Techniques 28/11/16 Excel Functions and Formulas 14/11/16 Excel VBA (Visual Basic for Applications) 17/11/16 to 18/11/16 copy file creation Intranet / Internet Power Users and Administrators Introduction to Drupal Microsoft Outlook Office User 26/10/16 Microsoft PowerPoint 2016 (2010, 2013) 10/10/16 Microsoft Project Basic Introduction 27/10/16 to 28/10/16 Microsoft Publisher Office User 12/10/16 Microsoft Visio Basic Introduction 15/11/16 Microsoft Word 2016 Office User (2010,2013) 24/10/16 SharePoint Internet / Intranet Contributors 11/11/16 SharePoint Power Users & Site Administrators 24/11/16 to 25/11/16 SharePoint Theming and Development 05/12/16 Recent blog postsWindows Explorer crashes due to the Quick Access View Issue with configuring Guest network on Apple Airport Express Units Windows 7 says 'No connections are available' even when you are connected! 3CX version 15 with Yealink IP phones Following Windows 10 upgrade, mapped drives disconnect briefly Converting Lines to Polylines and PolyLines to Lines in AutoCAD MoreTags 20102016323cxactive xAirplayalignmentApp StepAppleApple Watcharc lengthAutoCADautodiscoverbitbusiness userscontentConverting to polylinecorrupt xml filecPanelcrashcrashingcroydondisconnecteddisplayingdrive mapsDrupale-learningeditionelevated permissionsemailexcelface-to-facefinding Id guidfreezesfreezingguest networkhanghtmlHyper-Vimpersonation stepinstalledinstructor-lediPadIpad mirroringiPhoneiPhone 6Ipodit trainingiTuneslayer managementLAYMGRLine to PolyLineLinesloading profileMacmacrosmapped drives disconnectmapped drives go offlinemapped drives lostmicrosoftMicrosoft Wordmissing virtual machinesmissing VMnetworkingnotOfficeoffice 2013office 365OS XoutlookOutlook 2013Outlook 2016Outlook for MacPeople pickerPolyline to LinePolylinesProfessionalPurleyReflector 2respondin