* * *

Author Topic: Copy mp3 files from nas to usb  (Read 318 times)

gambothell

  • New member
  • *
  • Posts: 26
Copy mp3 files from nas to usb
« on: March 16, 2017, 03:28:04 pm »
I have tried using fileutil copyfile to copy mp3 files stored on my nas to a usb drive. I get no errors, but the files do not copy. I tried using a TProcess to issue a cp command. Again, I get no errors, but the mp3 files are not copied. I have several mp3 players and I have written a synchronization program to keep them current with my nas music folder. Is this a permissions issue? I have no problem connecting to the nas or the mp3 player and can easily scan both directories. I have also tried using TProcess with elevated privileges with same results.
Any suggestions  :o

Leledumbo

  • Hero Member
  • *****
  • Posts: 7505
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Copy mp3 files from nas to usb
« Reply #1 on: March 17, 2017, 10:16:33 am »
Try displaying the output of SysErrorMessage(GetLastOSError) after CopyFile returns false.

gambothell

  • New member
  • *
  • Posts: 26
Re: Copy mp3 files from nas to usb
« Reply #2 on: March 18, 2017, 03:51:10 pm »
Thanks for the feedback. I will do that and report.

Bart

  • Hero Member
  • *****
  • Posts: 2596
    • Bart en Mariska's Webstek
Re: Copy mp3 files from nas to usb
« Reply #3 on: March 18, 2017, 04:43:37 pm »
You can use my FileCopy() from myfileutils.pp unit. It has a callback event to show progress of the copying.
If you feel paranoid like me, then define debug_paranoid. This will tell you what went OK and what wrong (your program needs to have a console if you define debug_paranoid).

Bart

gambothell

  • New member
  • *
  • Posts: 26
Re: Copy mp3 files from nas to usb
« Reply #4 on: March 19, 2017, 09:28:12 pm »
Thank you Bart, I will add that to my program. I did find my problem, it was a corrupted directory on the mp3 player.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus